Need help understanding why this function returns null

  

I am writing a Delphi Android app to use Google Push.
Here is the function in question. It always returns null:
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);

Comments are closed.