OneSignal

Contents

The OneSignal plugin is an client implementation for using the OneSignal Service. OneSignal is a simple implementation for delivering push notifications.

https://github.com/OneSignal/OneSignal-Cordova-SDK

Stuck on a Cordova issue?

Installation

Community Enterprise
ionic cordova plugin add onesignal-cordova-plugin npm install @ionic-native/onesignal
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More   or   Contact Us
ionic activate-native-ee --key=YOURPRODUCTKEY ionic integrations add @ionic-native/onesignal

Supported Platforms

  • Amazon Fire OS
  • Android
  • iOS
  • Windows

Usage

import { OneSignal } from '@ionic-native/onesignal/ngx';

constructor(private oneSignal: OneSignal) { }

...

this.oneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');

this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);

this.oneSignal.handleNotificationReceived().subscribe(() => {
 // do something when notification is received
});

this.oneSignal.handleNotificationOpened().subscribe(() => {
  // do something when a notification is opened
});

this.oneSignal.endInit();