This is a simple Capacitor app that illustrates how to integrate the OneSignal SDK.
To run the provided example, can use serve command:
npx cap serve
-
Create a simple capacitor project through command line.
npx @capacitor/cli create
-
Add android plugin to the created project
npx cap add android
-
Install onesignal cordova plugin inside project
npm install onesignal-cordova-plugin
npx cap sync
-
Confirm Cordova version:
npx cap ls
-
Open project in Android Studio
npx cap open android
-
Add intialization code to the bottom of the .js file that loads on app launch (note that this example app has upgraded from Cordova 2.x.x to 3.x.x so init code is different)
-
Run app and register user!