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);
var
LJSON: TJSONObject;
begin
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
Memo1.Lines.Add(TJson.Format(LJSON));
LJSON.Free;
end;
Regards,
Sarina