For Phonegap 3.0
###Current platforms supported:
- iOS
- Deployment target iOS 5.0
- Android
- Minimum Android SDK Version 10
- Target Android SDK Version 19
Our Source code for Phonegap versions before 3.0.0 can be found on our github release page.
###License Like most phonegap plugins, our plugin is under the Apache Version 2.0 license.
#Before You Install
It would help if you have already signed up with AppBlade to get your credentials. Sign up here!
Also make sure you have Xcode, and Eclipse installed (plugman as well if you want to add the plugin automagically).
- Xcode Version 5 or above
- Eclipse Platform Version 4.3.2 with Android Development Kit 22.6.2 or above
- (optional) plugman version 0.10.0
AppBlade is plugman compatible for iOS (not Android, but we're working on that.)
plugman install --platform ios --plugin Your-Path-To-The-AppBlade-PhoneGap-Plugin/ --project Your-Project/platforms/ios/
##Manual 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.
*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 just 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.
##Manual 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.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 project included for examples using the other functions of the SDK.
##Resources: ###AppBlade.com ###AppBlade Support ###License and Terms