Using FCM for Android Push Notifications

I have a couple of doubts regarding how push notifications can be enabled so that we can use them in an Android application.

1. I am using Firebase Cloud Messaging API v1, as the older one has been deprecated. Even after setting up the service account for that, I am unable to find the FCM Project URL. Does it follow this format: https://fcm.googleapis.com/v1/projects/{project_id}/messages:send

2. Why am I getting 605 and 103 errors while registering the device to the FCM service?

3. Is it necessary to do the FCM registration via an APIK of the application, or can I do that in the Volt MX app also?

4. Do I need to place the google-services.json file inside the project directory that I got from the firebase console? Also, are there any other specific files that I need to make to get FCM work?

Hi @Vishal Vats ,

Can you please check the below article and let us know if it helps you in the implementation of FCM :

https://support.hcl-software.com/csm?id=kb_article&sysparm_article=KB0112550

Also it is recommended to use Foundry v9.5.16.6 for Android FCM to work correctly :

Reference : Volt MX Release Notes

Thanks !

I guess you were pointing to the Iris v9.5.16 As of now, I have the latest installed on my machine which is v9.5.35

@Pratiksha Shetty, I am getting Error code 605

What is wrong here. because I am not even calling the function to register the device for push notifications. I guess there are some syntactical issues.

Hi @Pratiksha Shetty, I am still looking for guidance over this FCM issue

I am using this code to set up FCM push notifications on an actual device. As of now, I have added the service account private key in the Engagement section of Foundry.

Now, I am facing a weird issue. If I call setupCallbacks(), then I get the 605 (Illegal arguments in the voltmx.push APIs) and 103 (Performing operation on a reference that doesn't exist) errors. What am I doing wrong in setting the callbacks?

If I omit the setCallbacks function and directly run the registerForPushNotifications(), then I do get the Allow Notifications alert in the apk. but it doesn't do anything as the callbacks are not set.

What am I missing, do I have to add permission, or stuff in the gradle file? What to do? Can anyone help?

@Gunndarr Dotter @Pratiksha Shetty @Suhas Bhat can you help me out

Hi Vishal,

If you haven't done this already, can you try adding the following to the build.gradle entries to Suffix in the Native -> Android Mobile/Tablet -> Gradle Entries section?:

dependencies {
implementation 'com.google.firebase:firebase-iid:21.1.0'
}

Nope, it also didn't help @Nina Brown. It's really weird to see that the thing is working fine for the preview, while the same is not working via the APK. Even no error is showing up.

By the way, there is no need to use the google-services.json file in the project directory?

Any update on this?