I am trying to receive Android notifications using firebase. I have defined the below services. But the service MyFirebaseInstanceIDService
is running on running the app for the first time. I don't even have a database for the user at that time. I want to store the firebase token for the user, but first I want to make an entry for the user on first activity and start the services on the second activity. SO that I can store the token of the user.
Android Manifest file
<service
android:name="in.anamika.anamika.notifications.MyFirebaseMessagingService"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service android:name="in.anamika.anamika.notifications.MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>