0

i'm following this tutorial http://thundaxsoftware.blogspot.com/2017/01/firebase-cloud-messaging-with-delphi.html for using push notifications,

 {$IFDEF ANDROID}
   PushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM);
  PushService.AppProps[TPushService.TAppPropNames.GCMAppID] := '71553856XXXX';
{$ENDIF}
  ServiceConnection := TPushServiceConnection.Create(PushService);
  //ServiceConnection.Active := True; //Update
  ServiceConnection.OnChange := OnServiceConnectionChange;
  ServiceConnection.OnReceiveNotification := OnReceiveNotificationEvent;
  ServiceConnection.Active := True; 

  DeviceId := PushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceId];
  DeviceToken := PushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken];
  Memo1.Lines.Add(DateTimeToStr(Now) + ' DeviceID: ' + DeviceId);
  Memo1.Lines.Add(DateTimeToStr(Now) + ' FCM Token: ' + DeviceToken);
  Memo1.Lines.Add(DateTimeToStr(Now) + ' Ready to receive!');

value DeviceToken is blank ! but device id is shown, i'm using the same source code attached in the artical.

Omeg
  • 11
  • 3
  • You're setting Active to True on the ServiceConnection *before* you assign the event handlers. You should set it *after* assigning the event handlers – Dave Nottage Aug 29 '18 at 00:16
  • still blank token @DaveNottage – Omeg Aug 29 '18 at 01:32
  • by the way, if you want to play with firebird messaging, you can look the implementation here: https://github.com/Zeus64/alcinoe. you have an already made working demo (ALFirebaseMessagingDemo.apk) – zeus Aug 29 '18 at 19:42

0 Answers0