-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS Background Notifications 'contentAvailable' #37
Comments
Seems to be the same issue reported here : #35 If the code in setBadge() is hashed out , I can get notifications from the CordovaPush.push.on("notification", fn) handler. ERROR: Unhandled Promise rejection: undefined is not a function (near '...this.once...') ; Zone: ; Task: Promise.then ; Value: TypeError: undefined is not a function (near '...this.once...') setBadge@http://localhost:12760/__cordova/packages/activitree_push.js?hash=6790efaf59ddf737434821a3c8a75eced5662294:114:16
what does setBadge() do ? Best wishes, |
Hi Paul, an update on this .. I got the 'IOS background notifications' to work after
Not sure why this.once("ready") isn't working. With regards to the 'contentAvailable', this parameter is not set in the notification.js .. so, will be a quick fix. Works with METEOR@2.2 Thanks again , your work is much appreciated ! Beemer |
@buymybm100 |
no, i just used the cordova plugins specified in the example directory. re: "authorization notification" - do you mean the popup message on the Mobile that ask if you allow notifications ? |
Hi @buymybm100, try this one for payload (ios only):
for android you must implement different payload as mentioned in the document. Thanks & Regards |
Hi Paul,
Thanks so much for this package! I used your instructions and the example to get up and running. I am able to send notifications and receive them in pop-ups on the Mobile (outside the App). However, the CordovaPush.on("notifications") handler is not being called.
I am using your userPushNotification() meteor method .. and have the 'contentAvailable' flag set to true.
Below is the Final notification right before shoot out but content-available is not set.
....
Seems 'content-available' is needed for background notifications to work on IOS.
ref: https://github.com/havesource/cordova-plugin-push/blob/master/docs/PAYLOAD.md#ios-behaviour
I have tried hard-coding "content-available": 1 in the payload (in server/notification.js) but that didn't work either.
Have I missed something ? T
Best wishes,
Beemer
The text was updated successfully, but these errors were encountered: