ios message received on multiple times when the app is in foreground
I registered the push id only once but the token will generate twice in ios device.
@priyangamani please provide a sample project to reproduce and investigate the issue.
//LoginPage.js var pushPlugin = require("nativescript-push-notifications"); var http = require("http");
LoginPage.prototype.pageLoaded = function (args) { var settings = { senderID:'98765431234', notificationCallbackAndroid: function (message, data) { var payload = JSON.parse(data); switch (payload.action) { case "NEWS": alert(payload.id) break; case "MESSAGE": alert(payload.id) break; default: alert("message"); } notificationCallbackIOS: function (data) { alert(JSON.stringify(data)); }, badge: true, // Enable setting badge through Push Notification sound: true, // Enable playing a sound alert: true, // Enable creating a alert }; pushPlugin.register(settings, // Success callback function (token) { http.request({url:"http://192.168.10.189:50780/updatePush"+token, method: "POST", headers: { "Content-Type": "application/json"} }) var pushSettings = settings; if (token != '') { if (pushPlugin.onMessageReceived) { pushPlugin.onMessageReceived(settings.notificationCallbackAndroid); } } }, function (error) { console.log("Error"); } ); } }
Package.json "nativescript-push-notifications": "^1.0.5",