@safaAlshaarri wrote:
hi every one i have an app where i need to send notification it’s working very fine on emulator but on device it’s not working … it works when the app is opened but when it’s closed it don’t show
here is the used code
i used FMC providerasync getToken() { let token; if (this.platform.is('android')) { token = await this.firebaseNative.getToken() } if (this.platform.is('ios')) { token = await this.firebaseNative.getToken(); await this.firebaseNative.grantPermission(); } return this.saveTokenToFirestore(token) } // Save the token to firestore private saveTokenToFirestore(token) { if (!token) return; const devicesRef = this.afs.collection('devices') const docData = { token, userId: 'user:'+this.deviceID, } return devicesRef.doc(token).set(docData) } // Listen to incoming FCM messages listenToNotifications() { return this.firebaseNative.onNotificationOpen() }
firebase
“@ionic-native/firebase”: “^4.0.0”,
“angularfire2”: “^5.0.0-rc.11”,
“@ionic-native/background-mode”: “^4.20.0”,
please help me
thank u
Posts: 1
Participants: 1