Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Another Push Notification issue. iOS Cordova 3.9.1 - iOS app does not receive push if app is open, but it's fine if app

Hey guys, I've already opened this issue with Appery priority support, but I'd like to know if I'm the only one experiencing this issue, or if anyone else is having problems after updating their library version.

I recently upgraded to Library version 3.1, which included Cordova 3.9.1 for iOS (and 4.1.1 for Android). I've since recreated all of my Apple distribution certificates, Push APS certificate, and provisioning file... All fine. Uploaded to Apple App Store, all fine. Test from TestFlight, all is fine except: if the app is minimized, I can send a push notification (from Appery Push Notification console, or from my server code script), and it will be received by the device... Great.

However, when the app is open (which means that it SHOULD execute the code that I have in the Push Notification event for my page), nothing happens. For example, supposed I put this code in the Push Notification event for my start screen:

Image

Then if the app is open (or if you click on the push notification that is received while the app is closed), it should execute the code and give me an alert that says "Push Notification". Simple. It works correctly on Android, but on iOS, it's acting as if the app is ignoring the 'push-notification' event listener. It doesn't do anything. In other words, if my app is open, the user has no way to know that a push notification was received...

Also, I've tried other code, like:
pre
alert(arguments[1]);//this should show all of the push notification content/data
//works on android
/pre
pre
alert(data.message);//this should show only the message itself
//works on android
/pre

Neither of these is executing on the iOS.
Please note that in both cases (whether app is open or minimized/closed), the Push Notification console 'Schedule and History' is showing the message as Sent with no errors... So the problem is VERY likely from the code on the device.

Has anyone else experienced this since upgrading their library? Any ideas? There are a few issues that seem similar/related on StackOverflow, but none of the suggestions there have worked for me...

Thanks in advance!

Return to “Issues”