Firebase Cloud Messaging
Firebase Cloud Messaging HTTP v1 client — send Android, iOS and web push from Delphi using OAuth 2.0 service-account credentials.
Firebase Cloud Messaging HTTP v1 client — send Android, iOS and web push from Delphi using OAuth 2.0 service-account credentials.
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send messages at no cost.
TsgcHTTPGoogleCloud_FCM_Client| Standards & specs | Firebase Cloud Messaging · FCM HTTP v1 API reference |
| Component class | TsgcHTTPGoogleCloud_FCM_Client (unit sgcHTTP_GoogleCloud_FCM_Client) |
| Frameworks | VCL, FireMonkey, Lazarus / FPC |
| Platforms | Windows, macOS, Linux, iOS, Android |
The principal published / public properties used to configure and drive the component. Consult the online help for the full list.
TLSOptions | Published or public property used to configure or query the component. |
OnAuthToken | Published or public property used to configure or query the component. |
OnAuthTokenError | Published or public property used to configure or query the component. |
GoogleCloudOptions | Published or public property used to configure or query the component. |
LogFile | Published or public property used to configure or query the component. |
Version | Published or public property used to configure or query the component. |
The principal public methods exposed by the component.
LoadSettingsFromFile() | Public procedure exposed by the component. |
RefreshToken() | Public function exposed by the component. |
Clear() | Public procedure exposed by the component. |
Drop the component on a form, configure the properties below and activate it. The snippet that follows shows the typical Authorization configuration sourced from the online help.
oFCM := TsgcHTTPGoogleCloud_FCM_Client.Create(nil); oFCM.TLSOptions.IOHandler := iohOpenSSL; oFCM.TLSOptions.Version := tls1_3; oFCM.TLSOptions.VerifyCertificate := True; oFCM.TLSOptions.OpenSSL_Options.LibPath := oslpDefaultFolder;
TsgcHTTPGoogleCloud_FCM_Client *oFCM = new TsgcHTTPGoogleCloud_FCM_Client(NULL); oFCM->TLSOptions->IOHandler = iohOpenSSL; oFCM->TLSOptions->Version = tls1_3; oFCM->TLSOptions->VerifyCertificate = true; oFCM->TLSOptions->OpenSSL_Options->LibPath = oslpDefaultFolder;
oFCM = new TsgcHTTPGoogleCloud_FCM_Client(); oFCM.TLSOptions.IOHandler = TwsTLSIOHandler.iohOpenSSL; oFCM.TLSOptions.Version = TwsTLSVersions.tls1_3; oFCM.TLSOptions.VerifyCertificate = true; oFCM.TLSOptions.OpenSSL_Options.LibPath = oslpDefaultFolder;
The following scenarios are lifted verbatim from the online help. Each shows the configuration and method calls needed to drive the component through a specific real-world flow.
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send messages at no cost.
oFCM:= TsgcHTTPGoogleCloud_FCM_Client.Create(nil); oFCM.GoogleCloudOptions.Authorization := gcaOAuth2; oFCM.GoogleCloudOptions.OAuth2.ClientId := '... your google client id...'; oFCM.GoogleCloudOptions.OAuth2.ClientSecret := '... your google client secret...';
oFCM = new TsgcHTTPGoogleCloud_FCM_Client(); oFCM->GoogleCloudOptions->Authorization = gcaOAuth2; oFCM->GoogleCloudOptions->OAuth2->ClientId = "... your google client id..."; oFCM->GoogleCloudOptions->OAuth2->ClientSecret = "... your google client secret...";
oFCM = new TsgcHTTPGoogleCloud_FCM_Client(); oFCM.GoogleCloudOptions.Authorization = gcaOAuth2; oFCM.GoogleCloudOptions.OAuth2.ClientId = "... your google client id..."; oFCM.GoogleCloudOptions.OAuth2.ClientSecret = "... your google client secret...";
Every external claim links back to a primary source. The online-help references decode the canonical deep-link the company maintains for this component.
Demos\20.HTTP_Protocol\03.Google\03.Google_FCM