An example Cordova app with the OneSignal plugin version 5.0.0-beta1 intergated showing how to use each of its functions.
- To build the example first run
cordova platform add android
and/orcordova platform add ios
. - Open
www\js\index.js
and replace"b098f904-b0ee-4bc2-8e30-0de3ee24023c"
with your OneSignal App Id. - Build and run the app on your device with
cordova run android
orcordova run ios
.
To add the OneSignal to your Cordova project run the following.
cordova plugin add onesignal-cordova-plugin --save
See the OneSignal Cordova SDK Setup Guide for the full installation guide.
Take a look to our OneSignal Cordova SDK Migration Guide to learn more about the Cordova 3.x to 5.0.0 upgrade.