Closed leabdalla closed 4 years ago
I've implemented FireBaseX in my Ionic 4 app to send remote notifications.
this.platform.ready().then(() => { let platforms = this.platform.platforms(); if(platforms.includes('ios') || platforms.includes('android') || platforms.includes('mobile')){ this.firebase.getToken().then(token => { console.log(`FIREBASE TOKEN ${token}`); if(platforms.includes('ios')) this.firebase.grantPermission(); }); this.firebase.onMessageReceived().subscribe(data => { console.log('FIREBASE MESSAGE', data); }); } });
So when I open the app in iOS, it asks for permissions correctly.
Then I send test message and the console.log() appears correctly.
2020-02-05 17:35:38.282123-0300 Parkaz[86464:2354851] didReceiveMessage: { "collapse_key" = "com.myapp.app"; from = 678323471xxxx; notification = { body = teste; e = 1; tag = "campaign_collapse_key_5659280550157990837"; title = teste; }; }
However, if the app is not opened, nothing happens. The notification banner doesn't appear, no badge, no sound... nothing...
Am I doing something wrong?
How were you able to solve this? I've had this bug for months now. @leabdalla
I've implemented FireBaseX in my Ionic 4 app to send remote notifications.
So when I open the app in iOS, it asks for permissions correctly.
Then I send test message and the console.log() appears correctly.
However, if the app is not opened, nothing happens. The notification banner doesn't appear, no badge, no sound... nothing...
Am I doing something wrong?