Create the MyFirebaseInstanceIDService Service

The MyFirebaseInstanceIDService Service enables various aspects of sending tokens to the Hurree server.

  • It has the onTokenRefresh() method which gives you a new FCM token.
  • This token is then sent to the Hurree server.

To create the MyFirebaseInstanceIDService Service:

  1. Open your project in Android Studio and go File > New > Service > Service. New Service
  2. Enter the Class Name and then Finish. The new class will open. Class Name New Class
  3. In your project, open manifests > AndroidManifest.xml and ensure it looks like this: AndroidManifest.xml
  4. Add the following lines of code in the Application tag:

    <service android:name=".MyFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
    

    Add service to app manifest

results matching ""

    No results matching ""