Ionic Event

Ionic event not working,
I create a login page and publish an event to update menu item, and subscribe event in app.component.ts but this does not work

Can you copy the code in here?
I cannot reproduce this issue

-----login.component.ts---------
this.apiService.login(dataToSend).then(data=>{
this.loaderService.hide();
if(data[‘status’] == “Success”){
this.userService.setUserProfile(JSON.stringify(data[‘userprofileinfo’][0]));
this.userService.setAccessToken(data[‘access_token’]);
this.events.publish(‘user_login’);
}
else{
this.alertService.show("", “”, data[‘message’] );
}
})
.catch(error=>{
this.alertService.show(error.error.status, “”, message );
})

-----app.component.ts---------

initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleLightContent();
this.splashScreen.hide();
this.events.subscribe(‘user_login’, (data) => {
console.log(‘user_login’);
// console.log(data);
this.setUserProfile();
this.navCtrl.navigateRoot(’/home’);
});
});
}

This is working for some android phone not for all

I think your code should be working, as it is close to Ionic-Documentation:

Maybe the error is comming from the statusBar and/or splashScreen,
considering that it is working in some cases.

Did you try debugging it in your browser?
In another case you could console.log all data you try to transfer, which is not as easy as debugging, but still helpful.

Like:
console.log(data[‘status’] == “Success”);
if(data[‘status’] == “Success”){
this.userService.setUserProfile(JSON.stringify(data[‘userprofileinfo’][0]));
this.userService.setAccessToken(data[‘access_token’]);
this.events.publish(‘user_login’);
console.log(user_login);