Closed rooswelt closed 7 years ago
ParsePushPlugin.on('receivePN', function (pnObj) {
should trigger when you receive a notification in the foreground on iOS. A notification will not show however. You can show an alert, toast or something similar within the app.
I put my plugin callbacks inside a document ready callback for safety also.
Hello @rooswelt , has @quilligana 's comment address your issue?
If not, please give us a bit more context regarding how you've setup the receivePN
handlers.
This is the code I have in my app:
$ionicPlatform.ready(function() { if (window.ParsePushPlugin) { ParsePushPlugin.on('receivePN', function(pn) { alert('yo i got this push notification:' + JSON.stringify(pn)); }); ParsePushPlugin.on('openPN', function(pn) { alert('a notification was opened:' + JSON.stringify(pn)); }); } });
openPN is triggered normally when opening app from a notification receivePN is not triggered even if notification is sent (I see that in parse dashboard).
Note: I use parse dashboard to send text-only notifications.
RESOLVED
I had phonegap-plugin-push installed also from previous tests. I removed it, everything works as expected.
Thanks @quilligana and @taivo for the support anyway
Hope it helps
receivePN is never trigger when app is in foreground on iOS. Notification is not show either
Is this the expected behaviour?