FCM dashboard push marked as sent but never received by Android app

After Firebase deprecated their old fcm I’ve attempted to upgrade parse. I have notifications working for ios and they are being received by my app. Android notifications have been an issue.

Package.json

  "dependencies": {
    "@parse/s3-files-adapter": "^2.2.0",
    "axios": "1.6.0",
    "canvas": "^2.11.2",
    "crypto-js": "^4.2.0",
    "date-holidays": "^3.23.12",
    "express": "4.19.2",
    "parse": "4.1.0",
    "parse-server": "6.5.8",
    "parse-server-mailgun-adapter-template": "^1.1.7",
    "promisify-call": "^2.0.4",
    "qrcode": "^1.5.4",
    "twilio": "^5.3.2"
  },

index.js

  push: {
    android: { firebaseServiceAccount: `${__dirname}/firebase.json` },
    ios:     {
      token: {
        key:    `${__dirname}/ios_key.p8`,
        keyId:  '#mykey#',
        teamId: '#myid#',  // From https://developer.apple.com/account/#number/membership.
      },
      topic:      'com.package.vms', // App bundle identifier.
      production: true,  // For the released production app.
    },
  },

Sending pushes in parse dashboard is marking as sent, with successful delivery.
Logging within the calls is showing:

{
success: true,
messageId: ‘projects/projectname/messages/0:#number#%#number#’
}

Using firebase to send the notifications sends to my android app.

If anyone can point me to a possible solution it would be appreciated.

Hi sloq,

So the push notifications for Android have worked once? Did you try to target Android devices only and if yes does the status also indicate success in Parse Dashboard? Does the firebase service account you use have the cloudmessaging.messages.create permission? A valid google-services.json is also provided during the build process of your mobile app?

Regards
Valdes

Hi Valdes,

Thanks for the reply.

Yes, push notifications worked for Android, but only prior to July 22nd and the Firebase api update. Using firebase to send test pushes also work in the app.

Yes, in the parse-dashboard I targeted Android devices only and targeted a channel which the app successfully created. In the dashboard it indicated that the notification was successful/delivered.

The firebase service account used to create the key/firebase.json file was Firebase Admin SDK Administrator Service Agent and I was logging in with owner access so I am under the impression I have all the proper permissions attached.

A valid google-services.json is attached, I downloaded a new google-services.json to upload and it matched the existing one.

At https://console.cloud.google.com/apis/api/fcm.googleapis.com/metrics I am seeing logs with 200 responses

At this point I am thinking it must be an issue with my app and how firebase push notifications are being processed in app derailing at some point with parse, capacitor (which the app is built with), or an some native functionality.

Hello sloq,

It really looks like your problem is on the client side. Accidentally I have implemented push notifications for Android using the new Firebase Messaging API some weeks ago and can provide you some hints.

This are the crucial steps I have done on the client side in order to enable push notifications for Android:

- Updated Google Services dependency in project-level build.gradle file
- Added Google services Gradle plugin to app-level build.gradle file
- Downloaded google-services.json file from Firebase and saved it in the project
- Added jitpack as Maven repository to build.gradle (root)
- Added Parse SDK as dependency to module build.gradle
- Synced project with gradle files
- Created custom App class and initialized Parse there
- Registered custom App class in AndroidManifest.xml
- Added ParseFirebaseMessagingService to AndroidManifest.xml
- Added ParsePushBroadcastReceiver to AndroidManifest.xml
- Added default style for notifications to AndroidManifest.xml

In addition you have to check whether you have followed all steps to enable the use of Capacitor Push Notifiaction plugin from this guide.

I hope I could help you.

Regards
Valdes