这是我的代码
pushNotificationSetup() {
const options: PushOptions = {
android: {
senderID: 'xxxxxxxxx',
icon: 'icon',
sound: true,
vibrate: true
},
ios: {
alert: true,
badge: true,
sound: true,
}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => {
this.utilService.showToastMsg("success", notification.message);
});
pushObject.on('registration').subscribe((registration: any) => {
this.storageService.setLocalStorage('registered-device', registration.registrationId);
});
pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
}