1

Ii have configured android for FCM.

public class DERFirebaseInstanceIDService extends FirebaseInstanceIdService {

    @Override
    public void onTokenRefresh() {
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();

    }
}

The token that I get from firebase server is following

"c5pu6rD06ts:APA91bHEgXUbJR8UegRPnLMgowEC6QxUPP73TiSBIHG1Pe0I8u22298rjpbXBsK94ExTmTbL0VT009AhsIqgMSkoLFZJDuaPSpaLlqBAyIrrtzsdLuWhvCp6CtkZwMT88P-WxBFCT2DH"

This token contains double quotations. So what I am doing wrong that server send me this token. Can any one help me..?

Due to this , when server send request to this token I am getting following error

"message": "The registration token is not a valid FCM registration token", "domain": "global", "reason": "badRequest"

KENdi
  • 7,576
  • 2
  • 16
  • 31
Kamran Omar
  • 1,815
  • 9
  • 31
  • 49
  • [`FirebaseInstanceIdService` is deprecated](https://stackoverflow.com/a/51129304/7666442) – AskNilesh Apr 24 '19 at 05:35
  • 2
    You are probably copying pasting the token from the console with the enclosing quotes that are merely used to display it. – user2297550 Apr 24 '19 at 05:41
  • quotes are just to represent that its of type 'String'. – Sahil Apr 24 '19 at 06:04
  • As @user2297550 noted, you are possibly copying the string from the **debug console** which you captured using breakpoints. Try `Log` class to log the fcm, and see what's the output. – theapache64 Apr 24 '19 at 06:08

0 Answers0