Comments (10)
Hello @densk1,
thank you for your feedback! Do you by any chance know which field(s) in the payload caused the trouble with APNS? Do you have any additional error messages? Then we could potentially adjust the documentation accordingly.
Cheers
from node-pushnotifications.
I copy pasted the full object from the docs, so while I'm not sure off hand, I think it was caused by having an empty alert: {}
key in my data
object.
I'm happy to do a conclusive test this week and submit a PR tweak for docs if it helps.
from node-pushnotifications.
I would greatly appreciate that! Thank you! :)
from node-pushnotifications.
Ok, I've recreated this on IOS 11.3 iPhone 7.
Using the object as is in the docs, adding only a topic
value, you get an error that is roughly the following in the device console.
No values for, badge, sound, or alert, not notifying com.example.app
Excuse the roughness, I haven't the test device at home here, just a development build/install on my own device, so can't see device console.
Is that true?
No, In the object from docs both badge and sound have values. and alert: { }
is an empty object.
What fixed it?
- Commenting out the
mdm: ' ', // apn and gcm for ios
makes the device vibrate but no notification visibly appears. - This is because
alert: { }
is an empty object if// alert
is commented out, notification appears.
Suggestion
Is it worth commenting out the mdm line as a default, and adding the following in docs?
alert: { } // apn, will take precedence over title and body.
// Your notification won't appear on ios if alert is empty object
// If alert is an empty string 'title' and 'body' will show in Notification
// mdm: '' // (Mobile Device Management) apn and gcm for ios
from node-pushnotifications.
@densk1 Thank you for this research. I will do some more digging because there are ongoing discussions regarding the support of silent push notifications (#56), which you seem to have got working.
I will also look into the mdm
parameter and update the docs accordingly once I have some more insight
from node-pushnotifications.
Ok great,
Here is a complete list of the device console output when I send the push notification with the un-edited data
object.
default 10:05:22.464385 +0100 SpringBoard Received incoming message on topic com.domain.myapp at priority 10
default 10:05:22.465978 +0100 SpringBoard [com.domain.myapp] Received remote notification request B910-1D51 [ hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 0 hasMutableContent: 0 ]
default 10:05:22.466121 +0100 SpringBoard [com.domain.myapp] Deliver push notification request B910-1D51
error 10:05:22.466266 +0100 SpringBoard Ignoring notification with no alert, sound or badge (com.domain.myapp): B910-1D51
default 10:05:22.466391 +0100 SpringBoard [com.domain.myapp] Not saving push notification B910-1D51 to store [ error=Error Domain=UNErrorDomain Code=1401 "Notification has no user-facing content" UserInfo={NSLocalizedDescription=Notification has no user-facing content} ]
from node-pushnotifications.
I don't think I had silent notifications working, as the device is actually vibrating/beeping, just without a visible notification showing up because alert: {}
is empty. (With // mdm: ''
commented out)
Also .onNotification();
isn't been called.
from node-pushnotifications.
Hi @densk1 ,
I added your suggestions for improving the README in e8c684a.
Thank you for your input!
from node-pushnotifications.
Hello,
for our cordova apps we had problems with phonegap: true not receiving pn on ios.
from node-pushnotifications.
Hello,
could you please provide more details? Are there any logs or code you can provide?
from node-pushnotifications.
Related Issues (20)
- Android GCM Weird behavior v1.6.2 HOT 8
- Getting `Mismatchsenderid` error with firebase token HOT 6
- sendAPN handling of received token in success case inconsistent with other cases and providers HOT 1
- error when using a long expiry (from firebase cloud messaging) HOT 1
- rich push notifications on Android: possible values for data.style?
- Question: Increase Badge by 1 for thousands of users HOT 1
- Deeplink seems not working HOT 2
- Support for data-only messages on Android HOT 3
- Cannot create PushNotification instance HOT 2
- Android High priority on silent push. HOT 5
- Update node-forge to fix security vulnerabilities HOT 3
- JSON value '<null>' of type NSNull cannot be converted to NSString
- Unclear how to specify API key for gcm/fcm HOT 2
- Open handles after sending an APN notification HOT 2
- why my apn notification is seen as webPush ? HOT 1
- retriedResults undefined HOT 1
- iOS Simulator Push Tokens incorrectly identified as GCM tokens HOT 4
- Not all users receive push notifications HOT 2
- apn write failed: GOAWAY: PROTOCOL_ERROR Stream 5 does not exist
- Update typescript definitions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-pushnotifications.