I can not send a push notification with Firebase on Ionic 3. I have re-done the project several times, I have seen several tutorials, I have documentation, and no results so far. Who can at least look at my code to find out what's wrong?
CONFIG.XML
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
</platform>
<plugin name="phonegap-plugin-push" spec="^2.2.3">
<variable name="SENDER_ID" value="931157632289" />
</plugin>
App.componet.ts
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
alert('TESTE1');
this.push.hasPermission()
.then((res: any) => {
if (res.isEnabled) {
alert('We have permission to send push notifications');
} else {
alert('We do not have permission to send push notifications');
const options: PushOptions = {
android: {},
ios: {
alert: 'true',
badge: true,
sound: 'false'
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => {
alert(notification.message);
});
pushObject.on('registration').subscribe((registration: any) =>{
alert( registration);
});
pushObject.on('error').subscribe(error =>{
alert(error);
});
}
});
});
IMAGE 1:
IMAGE2:
IMAGE 3: