Skip to main content

Integration Steps

1

Create Firebase project in firebase console

To start sending notifications from FCM, you’ll have to first create a firebase project. Create firebase project and application in firebase console with your applications package name which you can find in MainApplication.java or AndroidManifest.xml
2

Adding google-services.json

You can get your Service Account JSON by following these instructions. Download google-services.json and add the file inside your android>app folder.
3

Adding Firebase dependencies and plugins

Add below dependency inside projects build.gradle inside dependencies
Add below plugin inside apps build.gradle
Add below dependency inside apps build.gradle inside dependencies
4

Implementing push

Push feature can be implemented in two ways:
Since your service is registered in the app manifest, to render the push notification directed from SuprSend server you will have to add the below code to your service.
5

Sending the FCM token to SuprSend

Asking for permission -Android 13(API-33)

If the androidx dependency is not present then you will have to add the below dependency in your app dependencies
How to identify if notification is sent by SuprSend?If notification payload contains key supr_send_n_pl then simply consider this as payload sent from suprsend and pass the payload to suprsend SDK by:if (payload?.data?.supr_send_n_pl) { suprsend.showNotification(payload.data.supr_send_n_pl); }