Hi guys, i want to ask how to provide FCM token.
In my logs in firebase there are such a message "There are no notification tokens to send to".
How about now? How do you solve that?
FirebaseInstanceIdService is deprecated which you need to update manually to make it work.
-
In
.notifications.ChatFirebaseMessagingServiceyou need to copy theonTokenChangefrominstanceid.service.SaveFirebaseInstanceIdService. Then you can delete SaveFirebaseInstanceIdService.class. -
change the
onTokenChange()toonNewToken(). -
Search for the classes:
.core.ChatManager ; .core.authentication.ChatAuthentication; .core.authentication.task.RefreshFirebaseInstanceIdTask -
Change
String token = FirebaseInstanceId.getInstance().getToken();toFirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener<InstanceIdResult>() { @Override public void onSuccess(InstanceIdResult instanceIdResult) { String newToken = instanceIdResult.getToken(); Log.i(TAG_TOKEN, "RefreshFirebaseInstanceIdTask: token == " + newToken); } }); -
in AndroidManifest delete
service android:name=".instanceid.service.SaveFirebaseInstanceIdService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> </intent-filter> </service>