I'm sending push notification using azure notification hub by node js script. I can send and receive push notification. I don't know how to retrieve data. I'm sending push as follows:-
function sendNotifications(pushMessage) {
console.log('inside sendNotifications');
var hub = azure.createNotificationHubService('hubname','connection string');
hub.mpns.sendToast(
null,
{
text1: pushMessage,
text2: 'some data'
},
function (error)
{
if (!error)
{
//message send successfully
console.log("mpns.sendToast push success: "+error);
RESPONSE.send(statusCodes.OK, { ResponseMessage : 'mpns.sendToast message success' });
}
else
{
// msg failed to send
console.log("errro error.shouldDeleteChannel: "+error);
RESPONSE.send(statusCodes.OK, { ResponseMessage :'mpns.sendToast message error '+error });
}
});
}
I would like to receive the text1 and text2 in my receiving application. Could you inform me how to do it? Or do I need to send push notification differently if I want to push some data? How to push data together with push nitrification? Also how large data I can push?