Jump to content
Eric Bonilha

Firebase Push Notification for IOS

Recommended Posts

Hello

 

For the past few days I've been struggling trying to get the new Firebase integration of Delphi 11 (that was added in 10.4) for IOS to work, for Push Notification. 
Embarcadero really does a very poor job of documentation and sample code.. I'm impossible that they developed and never tested if this works...

 

All the sample codes I found on the internet refer to the use of KastriFree library for FCM for IOS on Delphi, but supposedly, FCM for IOS support was added natively... and I would like to use the native implementation from Delphi instead of the third party library.

 

I believe I have done all steps necessary (There are so many)

 

Basically the iOS application is compiling with FCM successfully and it is starting as I can retrieve the phone Token, that is used to send the notification to.. but when I send notification on Firebase its never received by the phone, not even the test message from Firebase console...

 

My firebase account is correctly linked to APNS using the APNS Key from apple

 

Is there any tutorial on how to use Firebase Push Notification with iOS for Delphi 11 using the NATIVE implementation found on the new unit FMX.PushNotification.FCM.iOS ??

  • Like 1

Share this post


Link to post

Looks like Firebase is failing to initialize with this message: 'no valid “aps-environment” entitlement string found for application'

I have selected remote-notification on UIBackgroundModes

 

My provisioning certificate does have Push Notification selected... I don't know what to do

Share this post


Link to post

That problem I solved, the entitlements was missing:
<key>aps-environment</key>
    <string>development</string>

 

but still, FCM loads with no errors now, but no messages are received.. god...

Share this post


Link to post

I was able to receive a push notification, but I had to change this line on FMX.PushNotification.FCM.iOS:

procedure TFcmPushService.RequestAuthorizationWithOptionsCompletionHandler(granted: Boolean; error: NSError);
begin
//  if not TiOSHelper.SharedApplication.isRegisteredForRemoteNotifications then
    TiOSHelper.SharedApplication.registerForRemoteNotifications;
end;
 

I had to comment out the line "if not TiOSHelper.SharedApplication.isRegisteredForRemoteNotifications then"

 

Not sure why.. but it was not calling registerForRemoteNotifications ever

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×