Mobile Push Notifications without a BaaS

Delphi, C++Builder and RAD Studio XE7 include support for mobile push (remote) notifications via a Parse and Kinvey BaaS providers. This makes it really easy to send push notifications to your users on mobile devices. Both Parse and Kinvey offer free service levels (as well as paid), and you can also download App42 SDK for Appmethod and use the App42 BaaS instead.

BaaS or Backend As A Service Providers are companies that maintain the backend servers necessary for many application development tasks. They handle things like user authentication, data storage, push notifications, etc. Sometimes they are referred to as mBaaS or Mobile-BaaS because if the heavy focus on mobile application development these days, but they typically are not tied to mobile.

This doesn’t mean you have to use a BaaS provider to send mobile push notifications. This is just the easy way. During CodeRage we’ve had sessions on how to do push notifications without a BaaS provider. It is different for both iOS and Android, so you are looking at a lot more code and effort, but it is possible.

CodeRage 9 had a session by Jeff LeFebvre had a session on Android Push notifications via Google Cloud Messaging (GCM):

Here is a transcript of the Q&A as well as download links.

For iOS & iPhone use of Apple Push Notifications (APN) Luis Felipe and Anders Ohlsson have some blog posts and videos on the subject. Luis did the original post and video in Spanish, and then Anders translated and expanded on it.

Luis’ post on iOS notifications with XE4 (Spanish but you can use Google Translate). It includes some source code downloads too. The video is also in Spanish but it shows a lot of source code, so it is easy enough to follow along.

Ander’s blog post expanding on it (English), and his CodeRage video on the subject (English)

Keep in mind that this is about the same level of complexity to use most other tools for sending and receiving push notifications.

This entry was posted in Android, iOS, Mobile. Bookmark the permalink.

4 Responses to Mobile Push Notifications without a BaaS

  1. Pingback: ??????? ?? ???? Delphi 22.12.2014 – 25.01.2015 | Delphi 2010 ru

  2. Bob Swart says:

    Any idea how to get this to work with Delphi XE8? In Delphi XE8 there are already libraries like cloud-messaging-dex.jar and google-play-services-dex.jar attached to an Android project, but these seem to work with EMS or BaaS providers only. Is it still possible to do Mobile Push Notifications without a BaaS in XE8 ??

  3. BIBD says:

    @Bob check out http://stackoverflow.com/a/27690786/685. Basically you can setup a Kinvey.com provider without the connection to Kinvey – and you are off to the races. Certainly works for Android. iOS looks promising (I get back the device token that matches what I see on MBaaS providers). I haven’t got the APNs server working yet.

  4. BIBD says:

    OK, gotcha that I came across with the direct APNs Push. When you export the p12 from the keychain you only need the certificate, not the key. If you do both, it won’t work – you’ll get a “Could not load certificate. error:00000000:lib(0):func(0):reason(0)” error when you connect the TCPClient.

    And because it’s kind of hard to see in the video the conversion from p12 to pem is done like this:
    openssl pkcs12 -in file.p12 -out file.pem -nodes

Leave a Reply