Using your own FCM

Info
Use the SDK’s helper methods in your implementation.

Enjoy the benefits of the Ocamba push service even if you are using FCM push notifications with your FirebaseMessagingService.

For example:

  1. Create FirebaseMessagingService:

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage);
    OcambaHoood.notification().onMessageReceived(remoteMessage);
    }
    
    @Override
    public void onNewToken(String token) {
    super.onNewToken(token);
    OcambaHoood.notification().pushToken(token);
    }
    
  2. Add service to AndroidManifest.xml:

    <service android:name=".NotificationReceiver">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>
    
On This Page