I am building an iOS app with Delphi Rad Studio Seattle 10. This application must receive push notifications. That works for me, but when the app is running, it does receive any notifications. What can I be doing wrong?
Here is the code:
var
APushService: TPushService;
AServiceConnection: TPushServiceConnection;
ADeviceID, AdeviceToken: String;
APushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.APS);
AServiceConnection := TPushServiceConnection.Create(APushService);
AServiceConnection.Active := True;
ADeviceID := APushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceID];
AdeviceToken := APushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken];
With this code, the app receives push notifications, but not when it is running.