• Модуль: pull
  • Путь к файлу: ~/bitrix/modules/pull/lib/push/servicelist.php
  • Класс: BitrixPullPushServiceList
  • Вызов: ServiceList::getServiceList
static function getServiceList(): array
{
	$result = [
		static::TYPE_APPLE => [
			'ID' => static::TYPE_APPLE,
			'CLASS' => ServiceApple::class,
			'NAME' => 'Apple Push Notifications'
		],
		static::TYPE_APPLE_VOIP => [
			'ID' => static::TYPE_APPLE_VOIP,
			'CLASS' => ServiceAppleVoip::class,
			'NAME' => 'Apple Push Notifications (Voip Service)'
		],
		static::TYPE_GOOGLE_REV2 => [
			'ID' => static::TYPE_GOOGLE_REV2,
			'CLASS' => ServiceGoogleInteractive::class,
			'NAME' => 'Google Cloud Messages rev.2'
		],
		static::TYPE_GOOGLE => [
			'ID' => static::TYPE_GOOGLE,
			'CLASS' => ServiceGoogle::class,
			'NAME' => 'Google Cloud Messages'
		],
		static::TYPE_HUAWEI => [
			'ID' => static::TYPE_HUAWEI,
			'CLASS' => ServiceHuaweiPushKit::class,
			'NAME' => 'Huawei Cloud Messages'
		]
	];

	foreach (GetModuleEvents("pull", "OnPushServicesBuildList", true) as $arEvent)
	{
		$res = ExecuteModuleEventEx($arEvent);
		if (is_array($res))
		{
			if (!is_array($res[0]))
			{
				$res = [$res];
			}
			foreach ($res as $serv)
			{
				if (!class_exists($serv['CLASS']))
				{
					trigger_error('Class ' . $serv['CLASS'] . ' does not exists', E_USER_WARNING);
					continue;
				}
				if (!($serv['CLASS'] instanceof PushService))
				{
					trigger_error('Class ' . $serv['CLASS'] . ' must implement ' . PushService::class .' interface', E_USER_WARNING);
					continue;
				}

				$result[$serv["ID"]] = $serv;
			}
		}
	}


	return $result;
}