• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/googleproxy.php
  • Класс: CGoogleProxyOAuthInterface
  • Вызов: CGoogleProxyOAuthInterface::getAppId
public function getAppId(): string
{
	if ($appId = trim(CSocServGoogleOAuth::GetOption("google_proxy_appid")))
	{
		return $appId;
	}

	$http = new HttpClient(["socketTimeout" => $this->httpTimeout]);

	$result = $http->post(static::TOKEN_URL, $this->getLicenseParams());

	try
	{
		$proxyData = BitrixMainWebJson::decode($result);
		CSocServGoogleOAuth::SetOption("google_proxy_appid", trim($proxyData['APP_ID']));
		CSocServGoogleOAuth::SetOption("google_proxy_api_key", trim($proxyData['API_KEY']));

		return $proxyData['APP_ID'];
	}
	catch(BitrixMainArgumentException $e)
	{
	}

	return '';
}