Package Exports
- ionic-native-fcm
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ionic-native-fcm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Ionic Native Fcm
Use this library to listen to Firebase Cloud Messages on Ionic 3.
Due to dependency issues of firebase and rxjs, one cannot use the @ionic-native/firebase with ionic v3. This package is created to easily implement Firebase Cloud Messaging in ionic v3.
Installation
npm i ionic-native-fcm
Supported Platforms
- Android
- iOS
Usage Examples
export class MyProvider {
private ionicNativeFcm: IonicNativeFcm;
constructor(){
//You might want to check for platform support here. (use ionic-angular/platform)
this.ionicNativeFcm = new IonicNativeFcm();
}
.
.
.
this.ionicNativeFcm.grantPermission();
.
.
.
this.ionicNativeFcm.onNotificationOpen().subscribe(message => {
this.onMessageReceived(message)
})
.
.
.
this.ionicNativeFcm.onTokenRefresh().subscribe(token => {
this.userService.updateTokenOnServer(token);
})
}