** This code is not working in iOS But properly working in Android .
Getting issue in subscribeToTopic
pushsetup()
{
console.log("*** inside push setup ");
this.fcm.subscribeToTopic(‘all’); //issue is here due to subscribe
this.fcm.getToken().then(token => {
console.log(" token is here ****");
console.log(token);
//backend.registerToken(token);
localStorage.setItem('fcmId', token);
if(this.device.platform){
this.getDeviceInfo();
}
});
this.fcm.onNotification().subscribe(response => {
console.log(response);
if(response.wasTapped) {
alert("Received in background");
} else {
alert("Received in foreground");
this.openPopup(response);
};
},
msg =>{
alert("error");
alert(msg);
});
// this.fcm.onMessageReceived().subscribe(response => {
// console.log(response)
// });
this.fcm.onTokenRefresh().subscribe(token => {
localStorage.setItem(‘fcmId’, token);
});
}