Firebase Integration

S’abonner

ARGO frontend provides feature to manage application notification. This section explains how to enable this feature in BEAR SDK by linking it to Firebase.

The Firebase integration is handled application side and not inside BEAR SDK. Don't hesitate to check Firebase instruction for adding Firebase to your application and setup your Firebase cloud messaging client.

For the notifications to work with BEAR SDK, you must provide BEAR with your Firebase legacy server key.

Finally you need to call BearSdk.registerFirebaseToken(String token) with the Firebase token. The Firebase token can be retrieved by overriding the onTokenRefresh() method of FirebaseInstanceIdService class:

public class FcmInstanceIdService extends FirebaseInstanceIdService {

    @Override
    public void onTokenRefresh() {
        super.onTokenRefresh();
        String token = FirebaseInstanceId.getInstance().getToken();
        if (token != null) {
            BearSdk.getInstance(this).registerFirebaseToken(token);
        }
    }

}

This way the Firebase token will be linked to the device id assigned at BEAR backend. You can retrieve this device id in your application by calling BearSdk.getDeviceId().

Cet article vous a-t-il été utile ?
Utilisateurs qui ont trouvé cela utile : 0 sur 0

Commentaires

0 commentaire

Vous devez vous connecter pour laisser un commentaire.