1
我正在通過節點js腳本使用azure通知中心發送推送通知。我可以發送和接收推送通知。我不知道如何檢索數據。我發送推送如下: -如何從推送通知中獲取數據?
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 });
}
});
}
我希望收到我的接收應用程序的文本1和文本。你能告訴我該怎麼做嗎?或者,如果我想推送一些數據,是否需要以不同的方式發送推送通知?如何推動數據一起推硝化?還有我可以推送多大的數據?
如果應用程序未打開,該怎麼辦?如何處理它? @Eran – SD7