Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:56:32+00:00 2026-06-09T04:56:32+00:00

I need to build a provider server in Delphi to send push notification messages

  • 0

I need to build a provider server in Delphi to send push notification messages to my iPhone app via APNS.

I have read that this is possible to do through Indy components. It is also required to install an SSL certificate (.p12) provided by apple.

I’m looking for some pointers to get started with this in Delphi.
What would be a good library to use, and does anyone know of any example code to do something like this?

Here are samples for Ruby & PHP, C# and JAVA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:56:34+00:00Added an answer on June 9, 2026 at 4:56 am

    OK I managed this as follows:
    Add an indy TidTCPClient and TIdSSLIOHandlerSocket on your form and link them. Set the SSL options in the TIdSSLIOHandlerSocket, set CertFile and KeyFile to the appropriate .pem files. Set method to sslvSSLv23 and mode to sslmClient.
    In the IOHandler‘s OnGetPassword event set your key’s password.

    Useful URLs:
    http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html
    http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12

    On the coding front:

    N.b. HexData is the ID sent from the IPhone App

    function SendNotification(HexData: String; Count: Integer): Boolean;
      var
        p_DataSize,
        I: Integer;
        p_payllen: Byte;
        p_json   : String;
        p_sndmsg : String;
      begin
    // Delphi 6 so needed to create JSON by hand<br>
        p_json := '{"aps":{';
        if (Count > 0) then
        begin
          p_json := p_json + '"alert":"You Have ' + IntToStr(Count);
          if (count = 1) then
            p_json := p_json + ' Reminder'
          else<br>
            p_json := p_json + ' Reminders';
          p_json := p_json + '","sound": "default",';
        end;
        p_json := p_json + '"badge":' + inttostr(Count) + '}}';
        p_payllen := length(p_json);
        // Hard code the first part of message as it never changes
        p_sndmsg :=  chr(0) + chr(0) + chr(32);
        // Convert hex string to binary data 
        p_DataSize := Length(HexData) div 2;
        for I := 0 to p_DataSize-1 do
          p_sndmsg := p_sndmsg + char(Byte(StrToInt('$' + Copy(HexData, (I*2)+1,
            2))));
        //Now need to add length of json string and string itself
        p_sndmsg := p_sndmsg + chr(0) + Char(p_payllen) + p_json;
        try
        // According to Apple can't connect/disconnect for each message so leave open for later
          if (not PushClient.Connected) then
            PushClient.Connect;
          PushClient.IOHandler.Send(p_sndmsg[1], length(p_sndmsg));
        except
          on e : exception do
            Log_Error(e.message);
        end;
      end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build app with user messages (dialogs). I've solved this problem by
I'd like to build an out-of-process COM server with Delphi that does not need
I need to build a push system in django, basicly its function is to
I need to build a dynamic linq query with or operators. I have seen
I need to build a client application that connects to the team foundation server
1. I need to build a Web Service Server (Simulator) which generates the xml
We have been using a web application framework to build apps that need to
I have a need to deploy email server and subsequently create java plugins for
I need to let my Rails app connect to a MS SQL Server database
I need to build a custom Suse Linux NFS Server that does compression on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.