The Cooee's Cordova plugin for customer engagement gives your team the power to easily integrate it in your Cordova (with Ionic) application. Follow these simple steps:
Add Plugin
Install the plugin using the popular single commands in the Terminal/PowerShell:
Cordova/Ionic will automatically pull the latest version of the plugin.
Replace MY_COOEE_APP_ID with the App ID which is present at Cooee Portal.
Notification Service Configuration (Only for iOS)
Plugin adds CooeeNotificationServiceExtension as a new target in the iOS platform. Just add build number and build version in the new target. Refer to the below image as a reference.
Permission Usage
Cooee uses few permissions if granted (we do not ask explicitly).
Android (Optional)
Cooee SDK supports prompting the following permissions via engagement. To make it work, you need to add the following in app's config.xml under <platforms name="android"> file:
XML
|
<!-- Cooee SDK use this permission to run Augmented Reality engagements --><config-filetarget="AndroidManifest.xml"parent="/manifest"><uses-permissionandroid:name="android.permission.CAMERA"/></config-file><!-- Cooee SDK use this permission to run Location based engagements --><config-filetarget="AndroidManifest.xml"parent="/manifest"><uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/></config-file>
iOS (Required)
Apple requires a user-friendly description of such permissions as defined here. Add below code in your config.xml under <platforms name="ios">.
XML
|
<edit-configfile="*-Info.plist"mode="merge"target="NSLocationWhenInUseUsageDescription"><string>App uses location to search retailer location</string></edit-config><edit-configfile="*-Info.plist"mode="merge"target="NSBluetoothAlwaysUsageDescription"><string>App uses Bluetooth to find out nearby devices</string></edit-config><edit-configfile="*-Info.plist"mode="merge"target="NSCameraUsageDescription"><string>Need to access your camera for a better AR experience</string></edit-config>
Android Configuration
The minimum supported android version for Cooee is API 21. Cooee SDK also supports Augmented Reality(AR). This requires a small configuration mentioned below in your config.xml under <platforms name="android">
XML
|
<!-- Add xmlns:android & xmlns:tools to widget tag--><widgetxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools">
...
<platformname="android">
...
<!-- Sets minimum Android SDK to 21 --><preferencename="android-minSdkVersion"value="21"/><!-- Enable google play service for Android --><preferencename="GradlePluginGoogleServicesEnabled"value="true"/><!-- Sets configuration for com.google.ar.core --><config-filetarget="AndroidManifest.xml"parent="/manifest/application"><meta-dataandroid:name="com.google.ar.core"android:value="optional"/></config-file><!-- Adds xmlns:tools in AndroidManifest.xml's manifest tag --><edit-configfile="app/src/main/AndroidManifest.xml"target="/manifest"mode="merge"><manifestxmlns:tools="http://schemas.android.com/tools"/></edit-config><!-- Adds android:name in AndroidManifest.xml's application tag --><edit-configfile="app/src/main/AndroidManifest.xml"target="/manifest/application"mode="merge"><applicationandroid:name="com.letscooee.cordova.CooeePluginController"tools:replace="android:name"/></edit-config></platform><widget/>