Giter Club home page Giter Club logo

Comments (10)

alex-friedl avatar alex-friedl commented on May 30, 2024

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.

densk1 avatar densk1 commented on May 30, 2024

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.

alex-friedl avatar alex-friedl commented on May 30, 2024

I would greatly appreciate that! Thank you! :)

from node-pushnotifications.

densk1 avatar densk1 commented on May 30, 2024

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?

  1. Commenting out the mdm: ' ', // apn and gcm for ios makes the device vibrate but no notification visibly appears.
  2. 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.

alex-friedl avatar alex-friedl commented on May 30, 2024

@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.

densk1 avatar densk1 commented on May 30, 2024

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.

densk1 avatar densk1 commented on May 30, 2024

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.

alex-friedl avatar alex-friedl commented on May 30, 2024

Hi @densk1 ,
I added your suggestions for improving the README in e8c684a.
Thank you for your input!

from node-pushnotifications.

sghoe avatar sghoe commented on May 30, 2024

Hello,
for our cordova apps we had problems with phonegap: true not receiving pn on ios.

from node-pushnotifications.

alex-friedl avatar alex-friedl commented on May 30, 2024

Hello,
could you please provide more details? Are there any logs or code you can provide?

from node-pushnotifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.