Watch, Follow, &
Connect with Us

Embarcadero Blogs

Latest Posts

Using Custom Endpoints to create a BaaS enabled Desktop application for sending notifications to your mobile apps

Yesterday, I wrote a blog post on how to send notifications via our BaaS (Backend as a Service) support in Delphi XE6 to your mobile devices on iOS and Android. This blog post assumes that you followed the steps in my previous blog post and in the referenced docwiki articles.

In this post, I thought I would cover how to send notifications from BaaS enabled FireMonkey or VCL Desktop apps to your mobile applications. My previous blog post covered how to send notifications to your mobile application using Kinvey’s web interface, but this allows you to create a FireMonkey or VCL Desktop application to send notifications to your mobile application.

Your Desktop application will connect with Kinvey in this case, then pass the message to Google’s Cloud Messaging service which then sends the notification to your mobile application.

If you want to pass a message from your Desktop app to Kinvey or Parse to be sent as a notification in your mobile client application, you can setup a custom endpoint. Inside your Kinvey account, go to Business Logic->Custom Endpoint and define your custom endpoint, i.e. MyMessage.

Next, you need to setup some custom code for your Custom ‘MyMessage’ Endpoint inside your Kinvey account (Business Logic->Custom Endpoint), i.e.:

function onRequest(request, response, modules) {

var iOSAps = request.body.iosaps;
var push = modules.push;
var iOSExtras = request.body.iosextras;
var androidPayload = request.body.androidpayload;
var androidmessage = androidPayload.message;
var message = request.body.message;
push.broadcastPayload(iOSAps, iOSExtras, androidPayload);
response.complete( 200 );

Then, on the KinveyProvider component, you need to set the PushEndpoint property to the name you defined (i.e. MyMessage) for the Custom Endpoint inside your Kinvey account.

On the Desktop app, I have a BackendPush component hooked into my Kinveyprovider component:

I also have a button on the form of my Desktop application that has the following event setup to send the notification containing the GCM title and GCM message from the Edit controls:

procedure TForm30.SendMessageClick(Sender: TObject);




I then connected my Edit controls to the BackendPush members for Google Cloud Messaging (GCM) via the LiveBindings Designer (View->LiveBindings Designer).

The Message property can be used across iOS and Android whereas the APS (iOS) and GCM (Android) fields are platform specific.

Now, messages I send from my Desktop app get sent to my mobile application.

For my mobile application, if I wanted to display both the message title and description in a ListView as shown in my previous blog post, I would have to update my PushEventsReceived event:

procedure TForm30.PushEvents1PushReceived(Sender: TObject;

const AData: TPushData);


ListView1.Items.Add.Text = AData.GCM.Title;

ListView1.Items.Add.Detail =  AData.Message;



posted @ Thu, 17 Apr 2014 22:35:58 +0000 by sarinadupont

Visualizing json data with LiveBindings

In RAD Studio XE6, we introduced support for Backend as a Service (BaaS) providers with components for Kinvey and Parse.

If you want to see the raw json data that you are sending/receiving with push notifications, you can enable it using the LiveBindings Designer. In this example, I am binding the PushEvents1.JSONResult property to the Memo1.Text property.

Any time I send a notification to my app (based on the instructions in this blog post), I will see the raw json data returned in my Memo. This is very useful for seeing what json you are sending and receiving.

If you wanted to do the same in code, you would setup the following OnPushReceived event for TPushEvents. You also need to add JSON.Rest to the uses clause:

procedure TForm29.PushEvents1PushReceived(Sender: TObject;

const AData: TPushData);




LJSON := TJSONObject.Create;

// Build JSON representation of push data

AData.GCM.Save(LJSON, ‘gps’);

AData.APS.Save(LJSON, ‘aps’);

AData.Extras.Save(LJSON, ‘extras’);

AData.SaveMessage(LJSON, ‘message’);

// Format JSON and append to memo






posted @ Thu, 17 Apr 2014 19:15:17 +0000 by sarinadupont

Using sensors in the VCL in Delphi XE6

One of the new features for the VCL XE6 is a availability of components for sensors.
Now, opening the Tool Palette in VCL project, you will see three new components on the Sensors tab. You may have already used them in your FM applications, then you can begin to use them and VCL. No changes, only one restriction - VCL applications only for windows. If you have a Windows tablet with sensors you can try to make your application more user-friendly and comfortable.

posted @ Thu, 17 Apr 2014 11:27:25 +0000 by nikolay

Использование датчиков в VCL в Delphi XE6

Одна из новых возможностей для VCL в XE6 это наличие компонентов для работы с датчиками.
Сейчас, открыв Tool Palette в VCL проекте Вы увидите три новых компонента на вкладке Sensors. Возможно Вы уже использовали их в Ваших FM приложениях, тогда Вы можете начать их использовать и в VCL. Никаких изменений, только одно ограничение – VCL приложения только для windows. Если у Вас есть Windows планшет с датчиками Вы можете попытаться сделать Ваши приложения более дружественными и удобными.

posted @ Thu, 17 Apr 2014 10:46:12 +0000 by nikolay

Example of using JavaScript for Google maps in the Delphi XE6

One of the innovations in XE6, it’s a method EvaluateJavaScript in the component TWebBrowser. This method allowing execute JavaScript on the loaded page and add interactivity to our applications.

On the site contains many examples of embedding maps on the page. I chose the example for paving the route from point A to point B. And as an example of execution JavaScript, I define two buttons for showing predefined paths from "Chicago" to "Winona" and from "St Louis" to "Gallup".

posted @ Thu, 17 Apr 2014 10:19:05 +0000 by nikolay

Использование JavaScript на примере Google maps в Delphi XE6

Одно из небольших нововведений в XE6 для компонента TWebBrowser, это появление метода EvaluateJavaScript, позволяющего выполнить JavaScript на загруженной странице и добавить интерактивности нашим приложениям.

На сайте приведено множество примеров встраивания карт на страничку. Мне приглянулся пример прокладывания маршрута из пункта А в пункт Б. Ну а в качестве примера выполнения JavaScript, я определю две кнопки для прокладывания предопределённых путей Из пункта chicago в пункт winona и из пункта st louis в пункт gallup.

posted @ Thu, 17 Apr 2014 09:18:35 +0000 by nikolay

Video: What's New in RAD Studio, Delphi and C++Builder XE6

Check out this video that covers some of the key new features of Delphi XE6C++Builder XE6 and RAD Studio XE6.

posted @ Thu, 17 Apr 2014 00:00:00 +0000 by Tim Del Chiaro

Remote push notifications on Android with RAD Studio XE6

In RAD Studio XE6, we introduced support for remote push notifications with our BaaS (Backend as a Service) integration. We include components for Kinvey and Parse, two popular BaaS providers, right out of the box.

In this tutorial, I am going to show you how to setup and enable push notifications in your C++ and Delphi applications using XE6. The Delphi or C++ code is the same across iOS and Android, but the steps for setting up notifications are different on Android than on iOS, since you are connecting with Google Cloud Messaging (GCM) on Android and with Apple Push Notification (APN) on iOS.

In order to receive push notifications, you need to set up the messaging service (APS or GCM), the device, the cloud service (Kinvey or Parse), and your RAD studio application. We have a great step-by-step tutorial on our docwiki that I recommend you look at since it walks you through all the steps.

My demo consists of a single form with a top aligned Toolbar and Label (to indicate the application name), and a client aligned ListView. The ListView will display each notification as a new item in the list. When the app is running in the background or is closed, you will see the notification displayed in the notification center on your device. On Android, you can access the notification center by swiping down from the top of your screen.

On my form, I placed 2 components:

  • TPushEvent, connected to my KinveyProvider component, with the following event setup:

void __fastcall TForm3::PushEvents1PushReceived(TObject *Sender, const TPushData *AData)


ListView1->Items->Add()->Text = AData->Message;



procedure TForm1.PushEvents1PushReceived(Sender: TObject;
  const AData: TPushData);
    ListView1.Items.Add.Text = AData.Message;

Next, you will need to setup the Messaging service. Please see this tutorial on how to register with Google and setup your push notification project. As part of that setup, you will be assigned a Project Number that you will need to enter on your Kinvey component, along with your Kinvey account info that you were provided when you signed up on and setup the project.

BaaS uses OpenSSL, but for Android, those files already exist on the file system, so you don’t need to add or link in any ssl library files. To send push notifications, you will need to login to your account, go to  Addons > Messaging > Push and connect your Kinvey account to your Google Cloud Messaging account:

  1. Copy:
    • the Project ID from your Google Cloud Messaging Setup
    • the API Key from your Google Cloud Messaging Setup
    CCG Configuration.png
To enable GCM support in an Android application, you will need to include some additional entries in the AndroidManifest.xml for the project. When you build your project, RAD Studio uses AndroidManifest.template.xml as a template to generate AndroidManifest.xml in the output directory.
You will need to edit the template file which lives in the same folder as your project. You can access it in your project folder (i.e. C:/MyPushDemo) after you have built the project. The entries you need to add are described here.
Now I am going to hit Run in the IDE to deploy the application to my Nexus 10.
To send the push notification to my app, I just had to click on Addons > Messaging > Push and select ‘Send a Push’.


posted @ Wed, 16 Apr 2014 21:09:36 +0000 by sarinadupont

RAD Studio XE6 has been released!

I’m so excited with the release of the latest version of RAD Studio, Delphi and C++Builder!

RAD Studio XE6 contains Delphi XE6 and C++Builder XE6 and marks the completion of the vision to support building apps for all major desktop (Windows, Mac) and mobile (Android, iOS) operating systems from the same codebase: C++ and Object Pascal!

The new IDE has a new look-and-feel, it is a lot faster and has tons of new and improved features for both desktop VCL Windows and multi-platform FireMonkey programmers!

Today at 3PM CET (and two other time slots for other timezones) there will be special "RAD Studio XE6: First Look webinar" and you can register here.

If you cannot make it for today for the online webinar, make sure to register for bi-weekly Developer Direct webinars where we are going to explore new XE6 features in depth or come to one of the many live events across the globe to see the new RAD Studio XE6 in action LIVE!

Register for the RAD Studio XE6, C++Builder XE6 and Delphi XE6 First Look Webinar

posted @ Wed, 16 Apr 2014 08:48:18 +0000 by Pawel Glowacki

C++Builder XE6 for Android Wallpaper

Remember the great Delphi for Android wallpaper? Well Dave has a new wallpaper to celebrate the new C++Builder for Android support. Thanks Dave for the great new wallpaper!

posted @ Wed, 16 Apr 2014 08:07:37 +0000 by Jim McKeeth

Server Response from: BLOGS2