Jump to content
Gitisme

Delphi iOS Push Notifications (APNS)

Recommended Posts

Hi

 

My app successfully receives a token from:
PushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.APS);

But when sending a notification to that token, I do not get a notification.

 

All i can find about remote notifications for Delphi 11.3 is Firebase sdk implementations.

 

Are we not able to use Apple push services anymore?

 

Thank you,

Share this post


Link to post
55 minutes ago, Gitisme said:

Are we not able to use Apple push services anymore?

You can use Apple Push Services, but it's for iOS only.

56 minutes ago, Gitisme said:

But when sending a notification to that token, I do not get a notification.

You don't give any details about how you're sending it, or what you are sending. Are you following the documentation, here? https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns?language=objc

Also, have you enabled Push Notifications for the App ID that is used in the Provisioning Profile for the application? Please refer to: https://blog.grijjy.com/2017/01/31/receiving-push-notifications-from-apples-push-notification-and-googles-firebase-cloud-messaging-services/

Share this post


Link to post

Thank you for the feedback.

I did not realize that Apple changed their push notification process that much, as I have been disconnected from it for a long time 😄

 

Problem on my server side was: I did not use a jwt.

 

All sorted now 🙂 

  • Like 1

Share this post


Link to post

hi all ,

 

there is a Server Side delphi example projet to send Apple push notification using tokens?

 

Thanks in advance

 

Beppe

Share this post


Link to post
4 minutes ago, Beppe Magistro said:

there is a Server Side delphi example projet to send Apple push notification using tokens?

Just Apple? There's this demo I put together a while ago - all it does is creates a message and performs the push. Make sure you read the readme at that link.

Share this post


Link to post

653821103_Screenshot2025-02-07alle16_39_43.thumb.png.1715d03c1309c7d8ab3e659625b04406.png

 

hi Dave,

 

I tried to build th example following the readme , but i have this errors.

 

it's Delphi 12.2

 

Thanks in advance

 

Beppe

Share this post


Link to post
On 2/7/2025 at 12:44 PM, Beppe Magistro said:

653821103_Screenshot2025-02-07alle16_39_43.thumb.png.1715d03c1309c7d8ab3e659625b04406.png

 

hi Dave,

 

I tried to build th example following the readme , but i have this errors.

 

it's Delphi 12.2

 

Thanks in advance

 

Beppe

 

You need to include the Kastri folders in the Library Path of Delphi so that the framework files are properly recognized. Kastri is a set of libraries and utilities for FireMonkey, very useful for specific functionalities on iOS and Android.

How to include Kastri in Delphi:

  1. Download and install Kastri
    If you haven't downloaded Kastri yet, get it from the official repository:
    https://github.com/DelphiWorlds/Kastri
    Extract the contents to a folder of your choice.

  2. Add the folders to the Library Path
    In Delphi, go to:
    ToolsOptionsLanguageDelphiLibrary
    Select the desired platform (Windows, Android, iOS, etc.) and add the following paths:

    • [Kastri_Path]\Core\
    • [Kastri_Path]\Core\D10_4 (or the corresponding folder for your Delphi version)
    • [Kastri_Path]\FMX\
    • [Kastri_Path]\Includes\
  3. Verify everything is set up correctly
    After configuring the paths, try compiling a test project using some Kastri functionality.

If you need help with anything specific, let me know! 🚀

Share this post


Link to post
5 hours ago, moises@coderbox.com.br said:
  • [Kastri_Path]\Core\D10_4 (or the corresponding folder for your Delphi version)
  • [Kastri_Path]\FMX\
  • [Kastri_Path]\Includes\

These parts make the whole answer smell of AI - a bad one, since those folders do not exist

  • Like 1

Share this post


Link to post
On 2/8/2025 at 2:14 AM, Beppe Magistro said:

653821103_Screenshot2025-02-07alle16_39_43.thumb.png.1715d03c1309c7d8ab3e659625b04406.png

My bad.. I had forgotten that I did some modifications to Grijjy.OAuth2.pas to allow signing with ES256 as well as RS256. For now, I've attached the modified unit here. Please place it in the same folder as the project.

 

Grijjy.OAuth2.pas

  • Like 1

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

×