Skip to main content
Version: v6


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

Please view the official OneSignal Ionic SDK Installation guide for more information.


If you want to use generated icons with command ionic cordova resources:

  1. Add a file to your hooks directory called copy_android_notification_icons.js

  2. Configure the hook in your config.xml

    <platform name="android">
<hook type="after_prepare" src="hooks/copy_android_notification_icons.js" />
  1. Put the following code in it:
#!/usr/bin/env node

var fs = require('fs');
var path = require('path');

var filestocopy = [{
}, {
}, {
}, {
}, {
} ];

module.exports = function(context) {

// no need to configure below
var rootdir = context.opts.projectRoot;

filestocopy.forEach(function(obj) {
Object.keys(obj).forEach(function(key) {
var val = obj[key];
var srcfile = path.join(rootdir, key);
var destfile = path.join(rootdir, val);
console.log("copying "+srcfile+" to "+destfile);
var destdir = path.dirname(destfile);
if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {

  1. From the root of your project make the file executable: $ chmod +x hooks/copy_android_notification_icons.js

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.


$ npm install onesignal-cordova-plugin 
$ npm install @awesome-cordova-plugins/onesignal
$ ionic cap sync

Supported Platforms

  • Amazon Fire OS
  • Android
  • iOS
  • Windows



Learn more about using Ionic Native components in React


import { OneSignal } from '@awesome-cordova-plugins/onesignal/ngx';

constructor(private oneSignal: OneSignal) { }


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


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

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