Hello everyone.
I have an app with push notification using onesignal. When I registered the player ID with method getIds it’s always null for pushToken value see in a picture below (in this case i’am using xiaomi with rom china). But, if i use another device it’s not problem. Is there any issue with rom china in this case.
Here’s the code for get player ID with one signal :
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public oneSignal: OneSignal) {
platform.ready().then((res) => {
if(res == 'cordova') {
this.oneSignal.startInit(Env.APP_ID_OS, Env.GOOGLE_PROJECT_ID);
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification);
this.oneSignal.setSubscription(true);
this.oneSignal.handleNotificationReceived().subscribe(() => {
console.log('Received Notification');
});
this.oneSignal.handleNotificationOpened().subscribe(() => {
console.log('Opened Notification');
});
this.oneSignal.endInit();
this.oneSignal.getIds().then(data => {
alert(JSON.stringify(data));
})
}
statusBar.styleDefault();
splashScreen.hide();
});
}
Thanks everyone.