Search code examples
iosdelphiapple-push-notificationsfiremonkey

Delphi Apple Push Notification not working on iOS while working on Android


I'm trying to include the Apple Push Notifications inside my iOS application following this example.

After some debugging I was able to find out that APushService is empty when running on iOS, but not on Android.

procedure TFormLogin.Button1Click(Sender: TObject);
var
    APushService           : TPushService;
begin

    APushService       := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.APS);

end;

Am I doing something wrong? How can we enable Push Notifications for iOS on Delphi?

Any ideas would be highly appreciated.


Solution

  • The solution was comically simple for the amount of effort we took to solve.

    FMX.PushNotification.iOS import was missing in the code.

    Funny thing is: if we remove the PushNotifications imports, Delphi Seattle won't show any warnings.