-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
Description
It seems that onToken
callback is never called. I reinstalled app and deleted token but none of these seem to trigger it.
Sample:
var messaging = firebase().messaging();
// This is never called
messaging.onToken(function(token) {
console.log(token);
});
messaging.showNotificationsWhenInForeground = true;
try {
await messaging.deleteToken();
let token = await messaging.getToken();
} catch(err) {
}
In order to confirm this, I also created my custom Service class and assigned it as a service into my app's manifest file.
The following class method was triggered on app start and token deletion.
package org.dnr;
public class FirebaseMessagingCustom extends com.google.firebase.messaging.FirebaseMessagingService {
@Override
public void onNewToken(String token) {
System.err.println("Token: " + token);
super.onNewToken(token);
}
}
I wonder if the following service declaration is really working: https://github.com/NativeScript/firebase/blob/main/packages/firebase-messaging/src-native/android/messaging/src/main/AndroidManifest.xml#L10