Push notifications not getting to device using activitree/meteor-push

Hi,

We’re trying to use

When we send notifs to Android from the Firebase Console, it works: the device receives it.

However, when trying to send notifications from the package like this:
image
it does send it “correctly” to Firebase but the device never receives it.

So, we played in the package to see the payload it sends to Firebase and by adding the “notification” section in the JSON payload, it works. The device gets the notification.

When only the android.data is there (the standard way the package works), the device does not get the notification.

There must be something wrong that we do because I assume that package works for everybody but us :wink:

Any idea what to do ?

@paulishca any idea what’s wrong with what we’re doing ?

Best regards,

burni

Hi @burni13 did you turn on the debugger for this package?

@paulishca thanks for your reply. Yes, it’s activated this way:

We’ve found 2 payloads that work so far. The one with the “notification” object within the “android” object :slight_smile:

And the version with the notification object outside in the main scope of “note” :

But using the standard way (without the notification object), FCM does not send the notification to the device (we confirmed by looking at adb logcat and xcode) even though it accepts the “send” from the plugin. We see the exact same messages in the debug console as the previous 2 payload versions:

I20220422-09:09:04.137(-4)? Push: Send message "title5" to user:  [ '2b5224ed9ddc40e1acf40264' ]
I20220422-09:09:04.157(-4)? Send to token {
I20220422-09:09:04.158(-4)?   android: 'd6oLZEtktgI:APA91bEXHanQ36CGw3G0Okp3c8hTq3p_KHs_zWKarlht6MlSNX5nQmQsuSff-yL-ItrKt0Jq0ty5OQcrs0yfc_LQfB1McGyNWz92_oZjMFKwU5Hy1UhUgzHnm-kzPJz5RYgvjBrCQcNw'
I20220422-09:09:04.158(-4)? }
I20220422-09:09:04.158(-4)? Final notification right before shoot out: {
I20220422-09:09:04.159(-4)?       "android": {
I20220422-09:09:04.159(-4)?             "priority": "HIGH",
I20220422-09:09:04.159(-4)?             "data": {
I20220422-09:09:04.159(-4)?                   "title": "title5",
I20220422-09:09:04.159(-4)?                   "body": "text of the notif4",
I20220422-09:09:04.159(-4)?                   "text": "text of the notif4",
I20220422-09:09:04.159(-4)?                   "icon": "notifylogo",
I20220422-09:09:04.159(-4)?                   "color": "#337FAE",
I20220422-09:09:04.159(-4)?                   "sound": "note",
I20220422-09:09:04.159(-4)?                   "tag": "4",
I20220422-09:09:04.159(-4)?                   "channel_id": "com.hoptimizeme.hoptimizepro",
I20220422-09:09:04.159(-4)?                   "notification_priority": "PRIORITY_DEFAULT",
I20220422-09:09:04.159(-4)?                   "visibility": "PRIVATE",
I20220422-09:09:04.160(-4)?                   "image": "https://commons.wikimedia.org/wiki/File:Wikipedia_logo_593.jpg"
I20220422-09:09:04.160(-4)?             }
I20220422-09:09:04.160(-4)?       },
I20220422-09:09:04.160(-4)?       "apns": {
I20220422-09:09:04.160(-4)?             "headers": {
I20220422-09:09:04.160(-4)?                   "apns-priority": "10"
I20220422-09:09:04.160(-4)?             },
I20220422-09:09:04.160(-4)?             "payload": {
I20220422-09:09:04.160(-4)?                   "aps": {
I20220422-09:09:04.160(-4)?                         "alert": {
I20220422-09:09:04.160(-4)?                               "title": "title5",
I20220422-09:09:04.160(-4)?                               "body": "text of the notif4",
I20220422-09:09:04.160(-4)?                               "launch-image": ""
I20220422-09:09:04.160(-4)?                         },
I20220422-09:09:04.160(-4)?                         "badge": 3,
I20220422-09:09:04.160(-4)?                         "sound": "note.caf",
I20220422-09:09:04.160(-4)?                         "data": {}
I20220422-09:09:04.161(-4)?                   }
I20220422-09:09:04.161(-4)?             },
I20220422-09:09:04.161(-4)?             "fcm_options": {
I20220422-09:09:04.161(-4)?                   "image": "https://commons.wikimedia.org/wiki/File:Wikipedia_logo_593.jpg"
I20220422-09:09:04.161(-4)?             }
I20220422-09:09:04.161(-4)?       },
I20220422-09:09:04.161(-4)?       "webpush": {
I20220422-09:09:04.161(-4)?             "headers": {
I20220422-09:09:04.161(-4)?                   "Urgency": "high",
I20220422-09:09:04.161(-4)?                   "TTL": "3600000"
I20220422-09:09:04.161(-4)?             },
I20220422-09:09:04.161(-4)?             "data": {},
I20220422-09:09:04.161(-4)?             "notification": {
I20220422-09:09:04.161(-4)?                   "title": "title5",
I20220422-09:09:04.161(-4)?                   "body": "text of the notif4",
I20220422-09:09:04.161(-4)?                   "icon": "https://link_to_your_logo.jpg",
I20220422-09:09:04.161(-4)?                   "image": "https://commons.wikimedia.org/wiki/File:Wikipedia_logo_593.jpg"
I20220422-09:09:04.162(-4)?             },
I20220422-09:09:04.162(-4)?             "fcm_options": {
I20220422-09:09:04.162(-4)?                   "link": "https://hoptimizepro.com/app"
I20220422-09:09:04.162(-4)?             }
I20220422-09:09:04.162(-4)?       },
I20220422-09:09:04.162(-4)?       "token": "d6oLZEtktgI:APA91bEXHanQ36CGw3G0Okp3c8hTq3p_KHs_zWKarlht6MlSNX5nQmQsuSff-yL-ItrKt0Jq0ty5OQcrs0yfc_LQfB1McGyNWz92_oZjMFKwU5Hy1UhUgzHnm-kzPJz5RYgvjBrCQcNw"
I20220422-09:09:04.162(-4)? }
I20220422-09:09:04.162(-4)? Push: Sent message "title5" to 0 ios apps | 1 android apps |  0  web apps
I20220422-09:09:04.211(-4)? Push, GUIDE: The "Push.appCollection" - No APN clients have registred on the server yet...
I20220422-09:09:04.489(-4)? Successfully sent message: projects/hoptimizeproapp/messages/0:1650632944452748%17d013c6f9fd7ecd

We really don’t understand why the “standard” payload version of the package works for you all and not for us.

Would you have an example of a payload that works for you in debug mode so we can compare ?

Best regards,

Burni13

Actually,

It seems to depend on the platform:

Android seems to accept a lesser amount of versions than iOS.

android.data = OK for iOS, not for Android (this is the current payload in the package)
data = OK for iOS, not for Android
notification = OK for both
android.notification = OK for both