Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Download the plugin
  • Add the plugin with the following command:

Versions under 1.5.0 (not including).

Code Block
languagebash
titleCordova CLI
cd Path/To/My/PhonegapProject
cordova plugin add /path/to/location/of/plugin

Versions 1.5.0 and above.

Code Block
languagebash
titleCordova CLI
cd Path/To/My/PhonegapProject
cordova plugin add /path/to/location/of/plugin

        OR, indicate if Android applications should open landing pages inside, or outside the application.

Code Block
languagebash
titleCordova CLI
cd Path/To/My/PhonegapProject
cordova plugin add /path/to/location/of/plugin --variable APX_OPEN_URL_INTERNAL='no' 
/* pass 'no' or 'yes' when adding the plugin to indicate if on Android, landing pages should be opened inside or outside the application. */

Integration - Phase 2

Android - Initialize the plugin in your Javascript application, as soon as possible, by calling the following:

Code Block
languagejs
titleInitialize plugin
function engage() {

	AppoxeePlugin.engage("sdk.id",
    	                "app.secret",
        	            function (json) {
            	        alert(JSON.stringify(json));
                	    },
                    	function (json) {
                    	alert(JSON.stringify(json));
                    	});
}


 iOS  - No need to explicitly engage the plugin via your JavaScript code.

  • iOS (versions 1.3.1 and 1 and above)

Add to your application plist file the "appoxee_sdk_key" with a string value of your application SDK key.

...

Code Block
languagexml
titleapplication.plist
<key>appoxee_sdk_key</key>
<string>the_sdk_key</string>

 

...


  • iOS 1.5.0 and above

Locate AppoxeeConfig.plist on the Cordova Xcode project file structure.

It will typically reside at ~/CordovaProject/Application_Name/platforms/ios/AppoxeeExample/Resources/AppoxeeConfig.plist

  1. Enter your SDK key.
  2. Choose the Appoxee environment to work against.
  3. Choose if landing pages open inside, or outside the application.

Image Added

Code Block
languagexml
titleapplication.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>sdk</key>
        <dict>
            <key>sdk_key</key>
            <string>123456789.00</string>
            <key>is_eu</key> <!-- Optional, indicate if account is EU / US -->
            <false/>
            <key>open_landing_page_inside_app</key> <!-- Optional, indicate if landing page should open inside the app or via Safari -->
            <false/>
        </dict>
    </dict>
</plist>


Note that iOS / Android applications will not share the same SDK key & secret, so you'll need to supply the right key for each platform, if you are compiling the same code for both platforms.

Note
titleContent Security Policy & inline functions

In order to:

  1. run the engage() method in your HTML code
,
  1. enable iOS10 with cordova

make sure your meta tag of Content-Security-Policy contains the following definition (allowing inline function and code execution):

Code Block
languagexml
titleHTML Code
  <meta http-equiv="Content-Security-Policy" content="script-src * default-src * gap://ready file:; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *"> 

Android small icon 

In order to override the small icon in the notification bar, you'll have to create a drawable named "apx_small_icon" - place an image file with that name in the project's drawable folder(s) (eg: <project>/platforms/android/res/drawable-xhdpi )