In my present venture, I uninstall the app from my cellphone then I start to get NotRegistered
each time I attempt to ship push notification to this Telephone Token
so, I deleted the token from my server, then I referred to as FirebaseMessaging.occasion.deleteToken();
when the person logout, understanding that Token is related to the gadget, not the person’s account.
So now when the Consumer login I name this FirebaseMessaging.occasion.getToken();
to get the brand new token, and replace the person account like this
FirebaseMessaging.occasion.setAutoInitEnabled(true);
FirebaseMessaging.occasion.getToken().then((worth) async {
print('TOKEN _$worth');
print('FireaseTOKEN :$worth');
String userId = await LocalStorageService.getString(LocalStorageService.userId) ?? "";
last myUser = await ref.learn(userRepositoryProvider).getUser(userId);
if (myUser != null && myUser.firebaseToken != worth) {
myUser.firebaseToken = worth;
await ref.learn(userRepositoryProvider).updateUser(myUser);
}
});
the brand new token is generated however the subject now’s after I ship a message to this new Token I at all times get NotRegistered
I even needed to name the Refresh Token however but, but it surely nonetheless didn’t work
Please, am I doing it the correct method or there’s something I am lacking?