📘
Awesome Cordova Plugins
  • Plugins
  • ABBYY Real-Time Recognition
  • Action Sheet
  • AdjustAppStoreSubscription
  • RewardVideo
  • AdMob Pro
  • AdMob
  • AES256
  • AllInOneSDK
  • Analytics Firebase
  • Android ExoPlayer
  • Android Full Screen
  • Android Notch
  • Android Permissions
  • Anyline
  • App Availability
  • App Center Analytics
  • App Center Crashes
  • App Center Low Memory
  • App Center Push
  • App Center Shared
  • App Preferences
  • App Rate
  • App Version
  • Apple Wallet
  • HTTP
  • Appsflyer
  • Background Fetch
  • Background Geolocation
  • Background Mode
  • FileTransferManager
  • Badge
  • Barcode Scanner
  • Battery Status
  • BioCatch
  • BiometricWrapper
  • BLE
  • BlinkId
  • Bluetooth Classic Serial Port
  • BluetoothLE
  • Bluetooth Serial
  • BranchIo
  • Broadcaster
  • Browser Tab
  • Build Info
  • Calendar
  • Call Directory
  • Call Number
  • Camera Preview
  • Camera
  • Checkout
  • Chooser
  • CleverTap
  • Clipboard
  • Cloud Settings
  • Code Push
  • CustomUISDK
  • Deeplinks
  • Device Accounts
  • Device Motion
  • Device Orientation
  • Device
  • Dfu Update
  • Diagnostic
  • Dialogs
  • DNS
  • iOS DocumentPicker
  • Document Scanner
  • Document Viewer
  • Dynamsoft Barcode Scanner
  • Email Composer
  • Answers
  • Facebook
  • FCM
  • File Opener
  • File Path
  • File Transfer
  • File
  • Fingerprint AIO
  • Firebase Analytics
  • Firebase Authentication
  • Firebase Config
  • FirebaseCrash
  • Firebase Crashlytics
  • Firebase Dynamic Links
  • Firebase Messaging
  • Firebase Vision
  • Firebase X
  • Firebase
  • Flashlight
  • Foreground Service
  • FTP
  • Gao De Location
  • GCDWebServer
  • Ge Tui Sdk Plugin
  • Geolocation
  • Globalization
  • Google Analytics
  • Google Nearby
  • Google Plus
  • Header Color
  • Health Kit
  • Health
  • HTTP
  • Coordinates
  • Iamport Cordova
  • IBeacon
  • Image Picker
  • Imap
  • In App Browser
  • In App Purchase 2
  • In App Review
  • In App Update
  • Insomnia
  • Instagram
  • Intercom
  • Ionic Webview
  • ios-aswebauthenticationsession-api
  • Is Debug
  • Keyboard
  • Keychain
  • Kommunicate
  • Launch Navigator
  • Launch Review
  • Line Login
  • LocalBackup
  • Local Notifications
  • Location Accuracy
  • Lottie Splash Screen
  • Media Capture
  • Media
  • Metrix
  • Mixpanel
  • MLKitTranslate
  • Mobile Messaging
  • Multiple Documents Picker
  • Music Controls
  • Native Audio
  • Native Geocoder
  • Native Keyboard
  • Native Page Transitions
  • Native Storage
  • NativeView
  • Network Interface
  • Network
  • UriHelper
  • OCR
  • OneSignal
  • Open Native Settings
  • OpenALPR
  • PayTabs
  • PDFGenerator
  • Photo Library
  • Photo Viewer
  • PlayInstallReferrer
  • Pollfish
  • Power Management
  • Power Optimization
  • PreviewAnyFile
  • Printer
  • PSPDFKit-Cordova
  • Purchases
  • Push
  • PushapePush
  • Safari View Controller
  • Save Dialog
  • Screen Orientation
  • Secure Storage Echo
  • Secure Storage
  • ServiceDiscovery
  • Shake
  • Sign In With Apple
  • SmartlookSetupConfigBuilder
  • Sms Retriever
  • SMS
  • Smtp Client
  • Social Sharing
  • Speech Recognition
  • Spinner Dialog
  • Splash Screen
  • Spotify Auth
  • Sqlite Db Copy
  • SQLite Porter
  • SQLite
  • StarPRNT
  • Status Bar
  • Streaming Media
  • Stripe
  • SumUp
  • System Alert Window Permission
  • Taptic Engine
  • TealiumAdIdentifier
  • TealiumInstallReferrer
  • Tealium
  • Text To Speech Advanced
  • Theme Detection
  • 3D Touch
  • Toast
  • Touch ID
  • DbResult
  • Uptime
  • UrbanAirShip
  • Usabilla
  • Vibes
  • Vibration
  • Video Editor
  • Video Player
  • Web Intent
  • Web Server
  • WebSocket Server
  • Webengage
  • Wechat
  • WheelSelector Plugin
  • WifiWizard2
  • Push Notifications - WonderPush
  • Youtube Video Player
  • ZBar
  • Zeroconf
  • Zoom
  • ABBYY Real-Time Recognition
  • Action Sheet
  • AdjustThirdPartySharing
  • RewardVideo
  • AdMob Pro
  • AdMob
  • AdvancedImagePicker
  • AES256
  • AllInOneSDK
  • Analytics Firebase
  • Android ExoPlayer
  • Android Full Screen
  • Android Notch
  • Android Permissions
  • Anyline
  • App Availability
  • App Center Analytics
  • App Center Crashes
  • App Center Low Memory
  • App Center Push
  • App Center Shared
  • App Preferences
  • App Rate
  • App Review
  • App Version
  • Apple Wallet
  • Applovin
  • HTTP
  • Appsflyer
  • Background Fetch
  • Background Geolocation
  • Background Mode
  • BackgroundUpload
  • Badge
  • Barcode Scanner
  • Battery Status
  • BioCatch
  • BiometricWrapper
  • BLE
  • BlinkId
  • Bluetooth Classic Serial Port
  • BluetoothLE
  • Bluetooth Serial
  • BranchIo
  • Brightness
  • Broadcaster
  • Browser Tab
  • Build Info
  • Calendar
  • Call Directory
  • Call Number
  • Camera Preview
  • Camera
  • CFPaymentComponentBuilder
  • Checkout
  • Chooser
  • Chooser
  • CleverTap
  • Clipboard
  • Cloud Settings
  • Code Push
  • Crop Plugin Privacy
  • CustomUISDK
  • Deeplinks
  • Device Accounts
  • Device Motion
  • Device Orientation
  • Device
  • Dfu Update
  • Diagnostic
  • Dialogs
  • DNS
  • iOS DocumentPicker
  • Document Scanner
  • Document Viewer
  • dynamsoft-barcode-scanner
  • Email Composer
  • Crashlytics
  • Facebook
  • FbSdk
  • FCM
  • FFMpeg
  • FileChooser Plugin
  • File MD5
  • File Opener
  • File Path
  • File Transfer
  • File
  • Fingerprint AIO
  • Firebase Analytics
  • Firebase Authentication
  • Firebase Config
  • FirebaseCrash
  • Firebase Crashlytics
  • Firebase Dynamic Links
  • Firebase Messaging
  • FirebaseModelInput
  • Firebase Vision
  • Firebase X
  • Firebase
  • Flashlight
  • Foreground Service
  • FTP
  • Gao De Location
  • gcdwebserver
  • Ge Tui Sdk Plugin
  • Geolocation
  • Globalization
  • Google Analytics
  • Google Nearby
  • Google Plus
  • Header Color
  • Health Kit
  • Health
  • HTTP
  • Coordinates
  • IRoot
  • Iamport Cordova
  • IBeacon
  • Image Picker
  • ImageResizer
  • Imap
  • In App Browser
  • In App Purchase 2
  • In App Review
  • In App Update
  • Insomnia
  • Instagram
  • Intercom
  • Ionic Webview
  • ios-aswebauthenticationsession-api
  • Is Debug
  • Keyboard
  • Keychain
  • Kommunicate
  • Launch Navigator
  • Launch Review
  • Lets Cooee
  • Line Login
  • LocalBackup
  • Local Notifications
  • Location Accuracy
  • Lottie Splash Screen
  • Device eMagnetometer
  • Market
  • Media Capture
  • Media
  • Metrix
  • Mixpanel
  • MLKitTranslate
  • Mobile Accessibility
  • Mobile Messaging
  • Multiple Documents Picker
  • Music Controls
  • Native Audio
  • Native Geocoder
  • Native Keyboard
  • Native Page Transitions
  • Native Storage
  • NativeView
  • Network Interface
  • Network
  • newrelic mobile
  • NFC
  • OCR
  • OneSignal
  • Open Native Settings
  • OpenALPR
  • PayTabs
  • PDFGenerator
  • Photo Library
  • Photo Viewer
  • PlayInstallReferrer
  • Pollfish
  • Power Management
    • Power Management
  • Power Optimization
  • PreviewAnyFile
  • Printer
  • PSPDFKit-Cordova
  • Purchases
  • Push
  • PushapePush
  • Safari View Controller
  • Save Dialog
  • Screen Orientation
  • Secure Storage Echo
  • Secure Storage
  • ServiceDiscovery
  • Shake
  • ASAuthorizationAppleIDRequest
  • Smartlook
  • SmsRetrieverApi
  • Sms Retriever
  • SMS
  • Smtp Client
  • Social Sharing
  • Speech Recognition
  • Spinner Dialog
  • Splash Screen
  • Spotify Auth
  • Sqlite Db Copy
  • SQLite Porter
  • SQLite
  • SSLCertificateChecker
    • SSLCertificateChecker
  • StarPRNT
  • Status Bar
  • Streaming Media
  • Stripe
  • SumUp
  • System Alert Window Permission
  • Taptic Engine
  • TealiumAdIdentifier
  • TealiumInstallReferrer
  • ConsentExpiry
  • Text To Speech Advanced
  • Theme Detection
  • 3D Touch
  • Toast
  • Touch ID
  • Unique Device ID
  • SyncResult
  • Uptime
  • UrbanAirShip
  • Usabilla
  • Vibes
  • Vibration
  • Video Editor
  • Video Player
  • Web Intent
  • Web Server
  • WebSocket Server
  • Webengage
  • Webim
  • Wechat
  • WheelSelector Plugin
  • WifiWizard2
  • UserPreferencesMethods
  • Youtube Video Player
  • ZBar
  • Zeroconf
  • Zip
  • Zoom
Powered by GitBook
On this page
  • Usage Documentation
  • Icons
  • Supported platforms

Was this helpful?

OneSignal

PreviousOCRNextOpen Native Settings

Last updated 3 years ago

Was this helpful?

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

Plugin Repo:

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

Please view the official 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>
  3. 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

Usage Documentation
https://github.com/OneSignal/OneSignal-Cordova-SDK
OneSignal
OneSignal Ionic SDK Installation