Jump to content

Ios Notification Error

Recommended Posts

I need to help about Firebase Notification service using Delphi Fmx.

I created a acount in Google FireBase. I achieved Android Notification in Delphi Fmx.

I created p8 file in MAc OX and add Firebase.

 Project Options Verion Info changed CFBundleIdentifier same bundle at Firebase

My code:

unit uMain;


  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Memo.Types,
  FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo , System.IOUtils, System.PushNotification
  {$ENDIF} ;
  TfrmMain = class(TForm)
    edt: TMemo;
    procedure FormCreate(Sender: TObject);
    { Private declarations }
    FDeviceId : String;
    FDevicetoken : String;
    FPushService: TPushService;
    FPushServiceConnection: TPushServiceConnection;
    procedure OnServiceConnectionChange(Sender: TObject; PushChanges: TPushService.TChanges);
    procedure OnReceiveNotificationEvent(Sender: TObject; const ServiceNotification: TPushServiceNotification);
    { Public declarations }


  frmMain: TfrmMain;


{$R *.fmx}

procedure TfrmMain.FormCreate(Sender: TObject);
   PushService: TPushService;
   ServiceConnection: TPushServiceConnection;
   Notifications: TArray<TPushServiceNotification>;
   PushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.FCM);
   ServiceConnection := TPushServiceConnection.Create(PushService);
   ServiceConnection.OnChange := OnServiceConnectionChange;
   ServiceConnection.OnReceiveNotification := OnReceiveNotificationEvent;
   ServiceConnection.Active := True;
   FDeviceId :=PushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceId];

   edt.Lines.Add('DeviceID: ' + FDeviceId);
   edt.Lines.Add('Ready to receive!');

   Notifications := PushService.StartupNotifications;
   if Length(Notifications) > 0 then
       edt.Lines.Add('DataKey = ' + Notifications[0].DataKey);
       edt.Lines.Add('Json = ' + Notifications[0].Json.ToString);
       edt.Lines.Add('DataObject = ' +

   ServiceConnection.Active := True; give me error Acess Violatin

 I colud  to need to your recommend 

Share this post

Link to post

I suceesded to get deviceId but take the Token give me error:

A valid "aps-enviroment" authorization key was not found for the application

Share this post

Link to post
Just now, MirDurmaz said:

A valid "aps-enviroment" authorization key was not found for the application

Does the App ID you are using have Push Notification entitlement?:



You set this on the Apple Developer website. If you have not already set this entitlement, after you do so you will need to recreate the Provisioning Profile

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