You can use the sample app provided with our Cordova SDK to customize and test your mobile app messages with minimal effort.
- Download the Cordova package and change to the samples/Sample folder.
- Install TypeScript compiler version 3 or later. Run
npm install typescriptto install the TypeScript compiler.
- Go to applications/samples/Sample/config.xml and modify the following:
- change widget node’s
android-packageNamevalue to your preferred Android package name.
- change the widget node’s
CFBundleIdentifierto your preferred iOS Bundle Identifier.
package.json namevalue to match the preferred Android package name.
To enable FCM support, copy the google-services.json file to the applications/samples/sample directory.
- Change directory to sample app directory.
- Open the postinstall_cordova.sh file in the applications/samples/sample directory.
- Configure your plug-in variables in the postinstall_cordova.sh file. When you complete this configuration, you no longer need to run the plug-in variables manually. For example,
location --variable SYNC_RADIUS=10000 --variable SYNC_INTERVAL=60 beacon --variable UUID=<UUID>
- Save the file.
npm installto build your plugins. The Android and iOS platforms and all the plugins are added to your project.
For the SERVER_URL for your pod, see Setting the baseURL.
- In Xcode, go to Project > Target > Capabilities and enable Push Notifications.
- Open the Xcodeproj file in platforms/ios/.xcodeproj. In the iOS sample app, you must change the app ID of the sample app to match the certificate’s app ID after you open it in Xcode.
If you do not set your team and provisioning profile, the app will not have permission to get the APNs deviceToken.
ANDROID_HOME variable. For example,
- Run the emulator for your sample apps.
- Build and run your Android and iOS apps.
Updated 10 months ago