Maksim Morozov Maksim Morozov - 20 days ago 18
JSON Question

Read a title of OneSignal Notification in PhoneGap

I use PhoneGap Build and OneSignal.
How can I read a title of notification in PhoneGap Project.
There is my code

receivedEvent: function(id) {
var iosSettings = {};
iosSettings["kOSSettingsKeyAutoPrompt"] = true;
iosSettings["kOSSettingsKeyInAppLaunchURL"] = false;

window.plugins.OneSignal.startInit( "*************************", "************")

function didReceiveRemoteNotificationCallBack(jsonData) {
alert('RECEIVE: ' + JSON.stringify(jsonData));
function didOpenRemoteNotificationCallBack (jsonData) {
alert('OPEN: ' + JSON.stringify(jsonData));


How to get a TITLE when Notification receive?
I found a Documentations but I don't understand


You can get it by calling jsonData.payload.title in your didReceiveRemoteNotificationCallBack function. See Onesignal's NotificationReceivedHandler documentation for a full list of properties.