Plugin for PhoneGap that uses the AppBlade SDK.
###Organization
For each operating system currently supported by the SDK there is a folder in the /Plugin
folder that contains the plugin, and a project in the /Examples
folder which should help you get started.
##Installation - iOS
- Copy
AppBlade.js
into yourwww/js
directory.
2. Copy `AppBladePlugin.h` and 'AppBladePlugin.m' into your Plugins folder.
3. Add the AppBlade SDK to your project.
*(These directions are for adding the binary compiled files, adding AppBlade source to a PhoneGap project is currently not supported)* *3a.* Drag the AppBLadeSDK folder with the AppBlade.h and libAppBladeUniversal.a files into your PhoneGap project in Xcode. (Make sure "Copy items" is checked.)
*3b.* Under "Link Binary With Libraries" In your Target's "Build Phases" Click the "+" button and add the Library named "Security.Framework" to your project.
*3c.* Build the Project in Xcode to ensure that everything is running.
4. Ensure "appblade.com" is in Cordova's whitelist.
*4a.* Open your config.xml file and find the access element (the line ``).
*4b.* If the `access` line is already `` Then nothing else needs to be done. ("*" means the whitelist is allowing all sources)
*4c.* If the `access` is not `` Then '' will have to be added.
5. Add AppBlade to your list of plugins
*5a.* Open your config.xml file and find the plugins list element (the line ` ... `).
*5b.* Add `` inside your list of plugins.
6. Make AppBlade.js referenceable.
*There are many ways to do this, as AppBlade.js can be treated jet like any other js file. This is just an example:*
*6a.* In your `index.html` file add `<script type="text/javascript" src="js/AppBlade.js"></script>` after the "cordova-2.5.0.js" script reference and before the "js/index.js" script reference:
<script type="text/javascript" src="cordova-2.5.0.js"></script>
<script type="text/javascript" src="js/AppBlade.js"></script>
<script type="text/javascript" src="js/index.js"></script>
7. Link your PhoneGap project to AppBlade.com *7a.* To use AppBlade features the app must first exist on AppBlade (click [+ New Project] after signing in). Get your project keys by navigating to your AppBlade project and selecting "Reveal your API Keys".
*7b.* In your `index.js`, underneath the `app.receivedEvent('deviceready');` call the setup method with your SDK keys in the order they appear on the AppBlade site: UUID, token, secret, issued at. The following example sets up the app blade plugin with API keys (actual values not used), sets up the crash reporter, and sets up feedback reporting.
onDeviceReady: function() {
app.receivedEvent('deviceready');
plugins.appBlade.setupAppBlade('[UUID]','[Token]', '[Secret]', '[Issued at]');
plugins.appBlade.catchAndReportCrashes();
plugins.appBlade.allowFeedbackReporting();
},
See the Example projects included for examples using the other functions of the SDK.
##Installation - Android
- Copy
AppBlade.js
into yourassets/www/js
directory.
1a. In your Package Explorer, expand your project and expandassets
>www
>js
1b. DragAppBlade.js
from the AppBlade Plugin Android folder into thejs
folder in your Package Explorer.
1c. Make sure "Copy files" is selected before selecting OK.
2. Copy `AppBladePlugin.java` into your project's package directory.
*2a.* In your Package Explorer, expand your project and expand src > [your.package.identifier]
*2b.* Drag `AppBladePlugin.java` from the Android folder into the package in your `src` folder that you would like your plugin to be referenced from. This is usually the package that was created automatically ([your.package.identifier]).
*2c.* Make sure "Copy files" is selected before selecting OK.
*2d.* In your project's copy of `AppBladePlugin.java`, change the package name from 'com.appblade.phonegappluginexample' to your package identifier.
3. Add the AppBlade SDK to your project.
*(These directions are for adding the app blade framework jar, adding AppBlade source to a PhoneGap project is currently not supported)*
*3a.* Open your `libs` folder under your project in the Package Explorer.
*3b.* Drag the included `appblade framework.jar` and `httpmime-4.1.2.jar` into the libs folder.
*3c.* Make sure "Copy files" is selected before selecting OK.
4. Ensure AppBlade.com is in Cordova's whitelist.
*4a.* Open your config.xml file and find the access element (the line ``).
*4b.* If the `access` line is already `` Then nothing else needs to be done. ("*" means the whitelist is allowing all sources)
*4c.* If the `access` is not `` Then `` will have to be added.
5. Add AppBlade to your list of plugins
*5a.* On Your Package Explorer, open your project's `config.xml` file in `res` > `xml` > `config.xml`
*5b.* Open the file with the text editor (right-click > `Open With...` > `Text Editor`, if necessary) and locate the plugins list element (the line ` ... `).
*5c.* Add `` inside your list of plugins. `[your.package.identifier]` is where `AppBladePlugin.java` is stored in your project's packages.
6. Make AppBlade.js referenceable.
*There are many ways to do this, as AppBlade.js can be treated jet like any other js file. This is just an example:*
*6a.* In your `index.html` file add `<script type="text/javascript" src="js/AppBlade.js"></script>` after the "cordova-2.5.0.js" script reference and before the "js/index.js" script reference:
<script type="text/javascript" src="cordova-2.5.0.js"></script>
<script type="text/javascript" src="js/AppBlade.js"></script>
<script type="text/javascript" src="js/index.js"></script>
7. Link your PhoneGap project to AppBlade.com *7a.* To use AppBlade features the app must first exist on AppBlade (click [+ New Project] after signing in). Get your project keys by navigating to your AppBlade project and selecting "Reveal your API Keys".
*7b.* In your `index.html`, underneath the `app.receivedEvent('deviceready');` call the setup method with your SDK keys in the order they appear on the AppBlade site: UUID, token, secret, issued at. The following example sets up the app blade plugin with API keys (actual values not used), sets up the crash reporter, and sets up feedback reporting.
onDeviceReady: function() {
app.receivedEvent('deviceready');
plugins.appBlade.setupAppBlade('[UUID]','[Token]', '[Secret]', '[Issued at]');
plugins.appBlade.catchAndReportCrashes();
plugins.appBlade.allowFeedbackReporting();
},
See the Example project included for examples using the other functions of the SDK.
##Resources: ###AppBlade.com ###License and Terms