Category Archives: iOS

Apple iOS

Delphi iOS Client Push Notification setup

Apple APNs iOS Client with Delphi 10.3+~

Prolog: A Lot is written how to implement APNs in various languages. I didn’t find, though proper one stop to learn how to implement APNs via IDERA’s Delphi. Basically, a main task with this procedure is with dealing with Apple Certifications (which is widely documented over many guides and sites).

Eventually you’d have to forge these files:

  • CertificateSigningRequest.certSigningRequest – to request a certification from Apple Services
  • Go to in Apple Developer Certification Web Console – to the AppID Identifier, and the Push Notification Capability – use the .csr to request a – And download .cer file.

    • Development SSL Certificate or
    • Production SSL Certificate
  • Use the aps_production_cert.cer – The Certification which needs to be installed in your Mac OS
    • clicking the ‘.cer’ file will add it to ‘My Certifications’ under the ‘Keys Chain’ – (Important this should appear on the ‘My Certifications’ if it isn’t there file won’t be able to get exported as a .p12)
  • Certificates.p12 – exporting the Push Certification as ‘.p12’
  • Certificates.pem – convert the ‘.p12’ file to ‘.pem’ file using openssl command:
    • openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes
  • entrust_root_certification_authority.pem – The Apple CA (it can be downloaded from
  • To test that I used the .php object (basically you can code a server using Delphi as well… but I tested that with this .php server object) from

We are using in Delphi the TMessageManager.DefaultManager class to register for various messages from the iOS APN service. Such as when registration and receiving from the system the Device TokenID. Or when this procedure fails.. http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Messaging.TMessageManager.SubscribeToMessage

And using the TiosHelper.SharedApplication to obtain the UIApplication and register the client iOS device for notifications using registerUserNotificationSettings(..); and registerForRemoteNotifications(); These procedures respond with a MessageData containing the unique device token.

uses
  // :
  FMX.Platform.iOS, System.Messaging, FMX.Platform,
  iosapi.Helpers, iOSapi.Foundation, FMX.Helpers.iOS, iOSapi.UIKit;

procedure TForm2.LogMsg(Value: String);
begin
  edtLog.Lines.Add(Value);
end;

procedure TForm2.RegisterNotificationClick(Sender: TObject);
var
  types: UIUserNotificationSettings;
begin
  // The token obtained from the TPushDeviceTokenMessage event should be used to identify the iOS client and send notifications to it
  TMessageManager.DefaultManager.SubscribeToMessage(
    TPushDeviceTokenMessage,  procedure(const Sender: TObject; const M: TMessage)
      begin LogMsg('TPushDeviceTokenMessage: ' + (M as TMessage<tpushdevicetokendata>).Value.Token); end);

  TMessageManager.DefaultManager.SubscribeToMessage(
    TPushFailToRegisterMessage, procedure(const Sender: TObject; const M: TMessage)
      begin LogMsg('TPushFailToRegisterMessage: ' + (M as TMessage<tpushfailtoregisterdata>).Value.ErrorMessage); end);

  TMessageManager.DefaultManager.SubscribeToMessage(
    TPushRemoteNotificationMessage, procedure(const Sender: TObject; const M: TMessage)
      begin LogMsg('TPushRemoteNotificationMessage: ' + (M as TMessage<tpushnotificationdata>).Value.Notification); end);

  TMessageManager.DefaultManager.SubscribeToMessage(
    TPushStartupNotificationMessage, procedure(const Sender: TObject; const M: TMessage)
      begin LogMsg('TPushStartupNotificationMessage: ' + (M as TMessage<tpushnotificationdata>).Value.Notification); end);

  types := TUIUserNotificationSettings.Wrap(TUIUserNotificationSettings.OCClass.settingsForTypes(
    UIUserNotificationTypeBadge or UIUserNotificationTypeSound or UIUserNotificationTypeAlert, nil));

  TiosHelper.SharedApplication.registerUserNotificationSettings(types);

  TiosHelper.SharedApplication.registerForRemoteNotifications();

  LogMsg('TiOSHelper.SharedApplication.registerForRemoteNotifications;');
end;

The new RAD Delphi XE6 was released

Note, this blog states the obvious.

Again I find myself in the process of waiting/reinstalling the new versions of the miscellaneous components — the I’ve bought. Each company got its own pace of releasing their updated set of components to their subscribers.

Some of them, got a hand of the beta testing of the RAD Delphi, and start to modify their components code, even before the official release of the development environment.

On other cases such as the Delphi Jedi Component Set — The  process seems to be a work in progress all the time. Due to the fact that it is defined as an opensource project. So many bugs, and improvements are being fixed, and added/modified almost everyday.

Yet, nowadays, that there is the Web, and all the social networks such as twitter/linkedin/facebook and so on — It seems that the wealth and variety of the set of libraries I come to find each and everyday, are much  more than what I thought there would be.

So It is good to get updated with many new tools, and utilities. You can call me a compulsive sourcecode collector. And due to the fact that I like the most the OOP with Pascal — I find everyday, new ways of coding in the same language that I happen to grow up with.

I didn’t had the chance yet, to cover all the different modifications that were added to the RAD Delphi XE6 —  itself… Though, I ran a couple of sample demo codes. I’ll be at this in the coming days.

GeoMaping software Mobile & Desktop

A short post about geomapping software; that I’ve encountered (on one way or another). The list is partial, and not the fullest current list of products of that sort, that you might find.

A list of Comparison of geographic information systems software on wikipedia.

Earth mapping:

Earth mapping software, that is being used mostly with GPS component to navigate:

  • Waze – Social mapping app, Mobile app (iOS/Android/Win8)
  • MapQuest – Mobile app
  • iGo NAVNGO – Can be found as a Mobile app for cellular devices (using iOS/Android/Win Mobile). Or as installed using a proprietary device.

Star systems and galaxy mapping / astronomy apps:


As a programmer I managed to play a little with the abilities of KML (Keyhole markup lanaguage) — I first encountered it when I had a list of locations which needed to be marked upon GeoLocations… I used it with the GoogleEarth engine.

Basically KML enables you to add layer of information, which can be presented in various ways upon the GeoPresentaion of an area. You can add markers/pictures/geometric objects/path to mark roads — etc’.

Due to the fact that KML is a very well defined structure, I ported the KML I created to a iGO NAVNGO system — that could read the KML file as well..

Podcasts RSS: Aggregating Video/Audio/Podcasts

I thought for a couple of days what to write about, due to the fact that nothing much kept me busy… Though, I came to a conclusion that I’ll write about what did keep me going on all these days.

For the past dozen years, I’ve been hearing many different daily Podcasts…

So what is a Podcast?

A Podcast, is basically a media file (can be audio or video) which is being attached to a RSS (Really Simple Syndication). The RSS with the combination of the media file, makes it a very power full technology. That because different Feeds are being updated daily or weekly.

The programs that manage the different feeds (Podcasts Apps; such as Apple Podcasts app [on iOS] or Samsung KiesCast app [on android]), you listen to — know 🙂 but their definition whether it is a new item, or an old one… Thus notify you for the new ones.

History of RSS…

The RSS first was invented for Text news… News Feeds, were common, yet, attaching a video/audio file to it was a latter invention.

More about Audio Podcasts:

There are some more features which were added to the Feed,. and can be supply attached to the RSS Feed it self, or to the media file which attached to it.

Meta Tags:

Take for example the Meta Tags.

When adding an item for a feed, it includes a text which describe the current item (of course these additions should be supplied in such a way that the miscellaneous Podcasts apps aggregators would know where to look for that data).  Due to the fact the the RSS was derived from XML (Extensible Markup Language) files — which is a structured text file, with different variables with in it — It can contain many different Meta Tags.

In addition misc meta tags can be attached to the media file itself. For example a .mp3/.m4a audio files contain a structure that define the file meta tags. And their meta tags can include many different known, or user defined tags. Such as; Track Name, Year Published, Author, Lyrics, Picture Thumbnail — Icon of the track, and so on.

Different Sources of RSS Podcasts:

Today any news organization which respect itself got a team that compile a hourly/daily/weekly podcast. After all, all you need to create a podcast — it the knowledge how to construct the basic feed, and some hardware such as microphone and a recording application… And of course some content to talk about whether it’ll be global news/ Tech news/ Expert news/ Art news/ or any area which interest you.

My personal daily news:

I’ve been listening, as I mentioned, for the past dozen years to news via different podcasts apps, and being fed news from different sources. This of course is a routine change from the past — instead of  gazing on a TV screen — I am now free, to hear news — what ever — when even — and where ever — I like.

What Ever; Pick from the billion of podcasts sources online.

Where ever; I can hear news while doing the daily arrangements around the house — when doing the dishes, or any other tasks.

When Ever; Feeds by different sources are usually kept at least for a week and on many cases for years back on different sources. So even if I missed something, or if I would like to listen to new content to me — I can search it years back on the source WebSite.

Or for short the podcasts WWW 🙂

APNS – Apple Push Notification Server

I’ve updated my code on the iOS client of the “Apple Push Notification Server”. With its companion the Server side. This version of code was written in Delphi, for windows desktop environment — and I’ve enhanced it a bit. Had to understand the thingies with the signing and all the procedure.
If you are in the progress of building one yourself here are my notes on the subject:

  • Make sure you are consistent with the type of app you are developing. Basically there are two kinds: Development & Production (Distribution). What ever you choose note the following assignments:
  1. Code sign your APNS with the proper type (DEV/PRO)
  2. Assign the server to be connected to the proper gateway:
    A. gateway.sandbox.push.apple.com:2195 – for DEV
    B. gateway.push.apple.com:2195 – for PRO
  3. Make sure your type is consistent to the client side (DEV/PRO) – The type of kind will produce a different value for the client APN Token when registration the client on the server side.

I’ve created a NotificationPanel for my windows desktop machine. Yet, it isn’t as fancy as the Apple/Google ones. But it inform me on different messages that I’ve connected it to. I’ve registered it as a COM AutomationObject, so it could be used in Microsoft VBA scripts, or similar applications.

One of the features of that code is the ability to send a message via my APNS registered server.

I am still trying to figure out, why not all of the messages being sent via the APNS reach the client side. I do not know where it actually fails [Client or Server side].

In addition there is the issue with the APNS feedback system (feedback.push.apple.com:2196) which I didn’t manage to verify its function. My version of code, for it, doesn’t seems to receive and feedbacks — whether messages has been sent properly or not, and if not — what is the exact reason.

Delphi XE5 beta6 testing for Windows/Android/iOS/MacOSX

I started checking the new XE5 beta 6. It is, as being a beta, a little unstable, yet from first testing I would highlight the following:

  1. Very good – Integration with the iOS & android SDK/NDK
  2. Very good and ease of deploying applications (to the android at least – that’s what I first checked).
  3. Ran bunch of demo applications which were under …/FiremonkeyMobile path. About 10 demos, 2 worked perfectly… yet all the other halted the compilation/deployment – due to reasons that I didn’t check deep enough… After tweeking some of the none working on the android platform, I managed to run most of them.
  4. I ran all through, all the availables Firemonkey sample demos, that are supplied when installing the XE — and modified them for use on mobile devices. Seems that about 30% could run without a problem – on mobile — yet the rest required a more enhanced modification of the code.
  5. In addition, I’ve modified a code that was originally was written using XE4, for compilation to iOS devices. It made use of the datasnap and the binding of data to a TListView. Slight modification of it made it useable on the android platform as well… here is a sample tast
  6. On my ToDo.list are:
    • Create a demo app that uses SQLite on android…. With a big DB about 1mil records 1gb sized.
    • Checking the ability of local Mobile DB, such as the SQLite on iOS, and the deployment process of SQLite DB on android.
    • See how a deployment of DataSnap on the android works, (done that, seems that all that was required is to set in the android uses/options ‘the internet connection’ to on the app security switches)
    • Reintroduction of the ability to display a 3d object such as .3ds file. With proper setting of the meshes on it.