Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ionic-native-fcm with all npm packages installed. Try it out:

var ionicNativeFcm = require("ionic-native-fcm")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ionic-native-fcm v0.0.7

Use this package to easily implement Firebase Cloud Messaging in ionic v3.

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);
  })
  
  
}

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free