我正在编写一个 Delphi Android 应用程序来使用 Google Push。
这是有问题的功能。它总是返回空值:
var
PushService: TPushService;
Notifications: TArray<TPushServiceNotification>;
ServiceConnection: TPushServiceConnection;
begin
PushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.Gcm);
Memo1.Lines.Add('PushService');
if not assigned(PushService) then
Memo1.Lines.Add('PushService error')
else begin
Memo1.Lines.Add('PushService ok');
PushService.AppProps[TPushService.TAppPropNames.GCMAppID] := '543546532983';
ServiceConnection := TPushServiceConnection.Create(PushService);
Run Code Online (Sandbox Code Playgroud)