-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Parse Server 3.9 Silent Push Notification on iOS 13 Not Working #6106
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
Comments
Can you share your current code so we can take a look and try to help you to figure it out? Anyway, I can take a look in this thread as it looks to be a good approach. |
I am sending this push notification from the dashboard with this JSON: |
I'm experiencing a similar issue. And I can see on my device logs that the notification is being delivered with a priority of 10, despite my having set priority to 5 in the data object. This is known to fail in iOS 13. This same setup (without push-type / pushType and priority) worked fine against iOS 12. |
Yeah something seems wrong here. Here's a snippet from an afterSave method I've got:
When one of these notifications is received on the iOS device, this is logged in the console:
So both the priority and the push type are wrong. Any ideas what I'm doing wrong here? EDIT: I was trying previously with the documented 'priority' rather than 'apns-priority'. Same result. |
I've spent most of the day trying to figure out how to debug installed modules in node; I'm an iOS guy usually. Now that I've got there, the implementation of the new iOS flags seems off. In node_apn/lib/notification/index.js in the exported It's the same mistake for all the others it seems. The tests in node-apn seem to test the default values given to the notification at init (like priority===10 and pushType===alert). That's why they pass. EDIT: Just double-checked, this isn't correct. I have no idea why the tests pass. My notifications have started working again locally by adding .payload in all the appropriate places in that I'll create a PR; this seems broken. |
@davimacedo Can you comment? I see you've been active on that repo. |
@drdaz Please check the Push Notification Guide
|
@dplewis I'm aware what the documentation says. What I posted here was a snippet where I was experimenting. The documentation is wrong about pushType, and the headers aren't being sent. |
Edited Looking at the JS Docs headers like The push adapter doesn't check the data field for headers.
Can you try if this works for you? |
I updated my comment. I wrote a failing test here |
I tried this adding
I don't think that was happening with the mods I made in the other PR. Just tested it. With the format you describe here, setting priority to a value other than 5 doesn't work. The incoming priority value on the device is always 1, and the notification is always delivered to the app with priority 5 as shown in that log snippet. Oddly enough, the push_type value seems to get sent just fine. |
@dplewis I've been poking at this, and I think I was mistaken. It's certainly hard to see why the code wouldn't behave as you describe, and even harder to see why it would ignore priority but not push_type. It looks like the priority the message is delivered to the app with, doesn't necessarily correspond with the arguments we assign. Apple's documentation only mentions priorities 5 and 10. And after some hours experimenting with this, I only see messages being delivered with priorities of 1, 5 and 10. Certainly my claim that the priority value being set here doesn't make a difference was wrong. Sending a background push with a priority of less than 5 doesn't get delivered to the device at all. |
TL;DR Yeah, that works. Thx. 🙏🏼 |
Are any of you guys able to send background notifications? I only receive them in-app on iOS... Here is the payload I am using
And I'm sending it using this code:
|
Read my #6106 (comment) This will be fixed in the next release. You don’t add push_type in the data field. Edit: sorry just read it, if you are able to receive it in your app is there an issue? |
I am trying to receive the notification in the background even if the app is in the background. So if the app is not in foreground, I still want to receive a silent push. Is this possible on iOS 13? It has been working for a long time. This is for the app CarMeets. www.carmeets.app Edit: Is my only option to send a non-background notification with alert? Currently the reason I send it in the background because it takes the notificationId in the payload and generates a client-side notification with the proper title/desc based on the 'Notification' object from Parse (queried by notificationId in push payload) |
If I remember correctly, Background apps have a 30 second max before they sleep. From what I read here, a background app will wake up for 30 seconds from a silent push. I may have misread it but feel free to open an issue one on the node-apn repo |
Closing via 3.10.0 |
Was anyone able to send silent push notifications? I am unable to receive the push although it says SENT, in the dashboard.
Can anyone send a sample code of the payload if you were able to successfully send one?
The text was updated successfully, but these errors were encountered: