You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
The callback push.on('notification') should be called on coldstart on iOS
Actual Behaviour
The callback push.on('notification') is not called on coldstart on iOS
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Open your app on iOS
Register for PN
Put the app in background
Trigger a PN
PN successfully arrives and on tapping on it the notification callback will be called.
Close the app
Trigger a PN again
Tap on the PN
The notification callback will not be called now
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS 9.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
cordova --version 6.0.0
cordova platform version ios 4.0.1
Plugin version
cordova plugin version | grep phonegap-plugin-push 1.6.0
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered:
addityasingh
changed the title
notification callback is not called on coldstart on iOS
push.on('notification') callback is not called on coldstart on iOS
Mar 29, 2016
I have found the solution for this one. The reason for this issue is that in PushPlugin.m the callbackId property is set to nil on killing the app. As a result, the check on line#441 is not satisfied in the - (void)notificationReceived callback. The fix for the issue is to instantiate the PushPlugin class on opening the push notification every time your app starts. This can be done by registering the push notification plugin on app start.
Call the PushPlugin.init method in your javascript everytime your app starts, and this will instantiate the plugin and assign the appropriate callback and callbackid in the plugin. I have added the below code to my Ionic app's app.run() section
Expected Behaviour
The callback
push.on('notification')
should be called on coldstart on iOSActual Behaviour
The callback
push.on('notification')
is not called on coldstart on iOSReproduce Scenario (including but not limited to)
Steps to Reproduce
notification
callback will be called.notification
callback will not be called nowPlatform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS 9.1(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered: