5.36.0 • Published 3 years ago

@ionic-native/onesignal v5.36.0

Weekly downloads
5,261
License
MIT
Repository
github
Last release
3 years ago

OneSignal

$ ionic cordova plugin add onesignal-cordova-plugin
$ npm install @ionic-native/onesignal

Usage Documentation

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

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.

Icons

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" />
    </platform>
  1. Put the following code in it:
#!/usr/bin/env node

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

var filestocopy = [{
    "resources/android/icon/drawable-hdpi-icon.png":
        "platforms/android/app/src/main/res/drawable-hdpi/ic_stat_onesignal_default.png"
}, {
    "resources/android/icon/drawable-mdpi-icon.png":
        "platforms/android/app/src/main/res/drawable-mdpi/ic_stat_onesignal_default.png"
}, {
    "resources/android/icon/drawable-xhdpi-icon.png":
        "platforms/android/app/src/main/res/drawable-xhdpi/ic_stat_onesignal_default.png"
}, {
    "resources/android/icon/drawable-xxhdpi-icon.png":
        "platforms/android/app/src/main/res/drawable-xxhdpi/ic_stat_onesignal_default.png"
}, {
    "resources/android/icon/drawable-xxxhdpi-icon.png":
        "platforms/android/app/src/main/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
} ];

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)) {
                fs.createReadStream(srcfile).pipe(
                    fs.createWriteStream(destfile));
            }
        });
    });

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

Supported platforms

  • Amazon Fire OS

    • Android
    • iOS
    • Windows
5.36.0

3 years ago

5.35.0

3 years ago

5.34.0

3 years ago

5.33.1

3 years ago

5.33.0

4 years ago

5.32.1

4 years ago

5.32.0

4 years ago

5.31.1

4 years ago

5.30.0

4 years ago

5.29.0

4 years ago

5.28.0

4 years ago

5.27.0

4 years ago

5.26.0

5 years ago

5.25.0

5 years ago

5.24.0

5 years ago

5.23.0

5 years ago

5.22.0

5 years ago

5.21.6

5 years ago

5.21.5

5 years ago

5.22.0-beta-1

5 years ago

5.21.4

5 years ago

5.22.0-beta-0

5 years ago

5.21.3

5 years ago

5.21.2

5 years ago

5.21.1

5 years ago

5.21.0

5 years ago

5.20.0

5 years ago

5.18.1-beta.5

5 years ago

5.19.1

5 years ago

5.19.0

5 years ago

5.18.1-beta.3

5 years ago

5.18.1-beta.2

5 years ago

5.18.1-beta.0

5 years ago

5.18.1-beta.1

5 years ago

5.18.0

5 years ago

5.17.1

5 years ago

5.17.0

5 years ago

5.16.0

5 years ago

5.15.1

5 years ago

5.15.0

5 years ago

5.14.0

5 years ago

5.13.0

5 years ago

5.12.0

5 years ago

5.11.0

5 years ago

5.10.0

5 years ago

5.9.0

5 years ago

5.8.0

5 years ago

5.7.0

5 years ago

5.6.1

5 years ago

5.6.0

6 years ago

5.5.1

6 years ago

5.5.0

6 years ago

5.4.0

6 years ago

5.3.0

6 years ago

5.2.0

6 years ago

5.1.0

6 years ago

5.0.0

6 years ago

5.0.0-beta.24

6 years ago

4.20.0

6 years ago

5.0.0-beta.23

6 years ago

4.19.0

6 years ago

5.0.0-beta.22

6 years ago

4.18.0

6 years ago

4.17.0

6 years ago

4.16.0

6 years ago

5.0.0-beta.21

6 years ago

4.15.0

6 years ago

5.0.0-beta.20

6 years ago

5.0.0-beta.19

6 years ago

4.14.0

6 years ago

5.0.0-beta.18

6 years ago

4.13.0

6 years ago

5.0.0-beta.17

6 years ago

4.12.2

6 years ago

4.12.1

6 years ago

5.0.0-beta.15

6 years ago

4.12.0

6 years ago

4.11.0

6 years ago

4.10.1

6 years ago

5.0.0-beta.14

6 years ago

4.10.0

6 years ago

4.9.2

6 years ago

4.9.1

6 years ago

5.0.0-beta.13

6 years ago

4.9.0

6 years ago

5.0.0-beta.12

6 years ago

4.8.0

6 years ago

5.0.0-beta.11

6 years ago

5.0.0-beta.10

7 years ago

5.0.0-beta.9

7 years ago

5.0.0-beta.8

7 years ago

5.0.0-beta.7

7 years ago

4.7.0

7 years ago

4.6.0

7 years ago

4.5.3

7 years ago

5.0.0-beta.6

7 years ago

5.0.0-beta.4

7 years ago

5.0.0-beta.3

7 years ago

5.0.0-beta.2

7 years ago

5.0.0-beta.1

7 years ago

4.5.2

7 years ago

4.5.1

7 years ago

5.0.0-beta.0

7 years ago

4.5.0

7 years ago

5.0.0-alpha.3

7 years ago

4.4.2

7 years ago

4.4.1

7 years ago

4.4.0

7 years ago

4.3.3

7 years ago

4.3.2

7 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.1

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

4.0.0-beta.1

7 years ago

3.14.0

7 years ago

3.13.1

7 years ago

3.13.0

7 years ago

3.12.2

7 years ago

3.12.1

7 years ago

3.11.0

7 years ago

3.10.3

7 years ago

3.10.2

7 years ago

3.10.1

7 years ago

3.10.0

8 years ago

3.9.2

8 years ago

3.9.1

8 years ago

3.9.0

8 years ago

3.8.1

8 years ago

3.8.0

8 years ago

3.7.0

8 years ago

3.6.1

8 years ago

3.6.0

8 years ago

3.5.0

8 years ago

3.4.4

8 years ago

3.4.3

8 years ago

3.4.2

8 years ago

3.4.1

8 years ago

3.4.0

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.4

8 years ago

3.2.3

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.1.0-rc.6

8 years ago

3.1.0-rc.5

8 years ago

3.1.0-rc.4

8 years ago

3.1.0-rc.3

8 years ago

3.1.0-rc.2

8 years ago

3.1.0-rc.1

8 years ago

3.1.0-alpha.3

8 years ago

3.1.0-alpha.2

8 years ago

3.1.0-alpha.1

8 years ago

3.0.0

8 years ago

3.0.0-alpha.1

8 years ago

3.0.0-alpha.0

8 years ago