I sent several notifications to my app when it’s closed and/or the device is shutdown. When I open my app and setup the receive notifications listener I don’t receive any notification.
But, after that, if I send a new notification I receive all the notifications not received before.
Why is it happening and how could I foorce push plugin to receive all sent notifications automatically?
Here is my push provider:
@Injectable()
export class PushProvider {
messages: any;
init(){
var push = Push.init({
android: {
senderID: "452854818286"
},
ios: {
alert: "true",
badge: true,
sound: 'false'
},
windows: {}
});
push.on('registration', (data) => {
console.log('REGISTRATION ID', data.registrationId);
});
this.messages = new Observable(observer=>{
push.on('notification', (data) => {
observer.next(data);
});
});
push.on('error', (e) => {
console.log(e.message);
});
}
}