Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Chat21 SDK creating multiple tokens for Messages? #54

Open
vikas-jain-plutus opened this issue Jan 20, 2021 · 6 comments
Open

Why Chat21 SDK creating multiple tokens for Messages? #54

vikas-jain-plutus opened this issue Jan 20, 2021 · 6 comments

Comments

@vikas-jain-plutus
Copy link

Can anyone please tell me to do this for any specific reason?

@andrealeo83
Copy link
Contributor

Are your referring to authentication token or other?

@vikas-jain-plutus
Copy link
Author

Actually, I am already generating the Firebase Token using below method.
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener() {
@OverRide
public void onComplete(@nonnull Task task) {
if (!task.isSuccessful()) {
fcm_token = task.getException().getMessage();
Log.w("FCM TOKEN Failed", task.getException());
} else {
fcm_token = task.getResult().getToken();
Log.i("FCM TOKEN", fcm_token);
}
}
});

But the problem is Chat21 SDK also registering new token and my previous token expired and I am not getting normal push notification. Is there any way we can restrict token generation from the Chat21 SDK?

@vikas-jain-plutus
Copy link
Author

Or else we can get the new token in MyFirebaseInstanceIdService?

@andrealeo83
Copy link
Contributor

If you authenticate the user outside Chat21 I think you should don't use the Chat21 authentication.

You must get the Firebase current user with:
FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

Create an IChatUser e start the Chat21SDK with:
ChatManager.start(this, mChatConfiguration, iChatUser);

See here an example: https://github.com/chat21/chat21-android-demo/blob/development_v2/app/src/main/java/chat21/android/demo/AppContext.java

@vikas-jain-plutus
Copy link
Author

vikas-jain-plutus commented Feb 3, 2021

I am not getting any notification when another user or member send me any message via Chat21 SDK.
Is there any other configuration for getting chat notifications?

Thanks in advance 💯

@vikas-jain-plutus
Copy link
Author

If you authenticate the user outside Chat21 I think you should don't use the Chat21 authentication.

You must get the Firebase current user with:
FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

Create an IChatUser e start the Chat21SDK with:
ChatManager.start(this, mChatConfiguration, iChatUser);

See here an example: https://github.com/chat21/chat21-android-demo/blob/development_v2/app/src/main/java/chat21/android/demo/AppContext.java

I am not getting any notification when another user or member send me any message via Chat21 SDK.
Is there any other configuration for getting chat notifications?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants