-
Notifications
You must be signed in to change notification settings - Fork 14
Feature Implementation Guide
For earlier versions of our SDK, check out our Old Feature Implementation Guide
This page helps to provide an index and walkthrough of each feature we support in our SDKs. Organized by platform.
While we try to supply the same abilities for each version of the SDK, features naturally vary across platforms.
You'll need to make a Project on AppBlade first before implementing any of the features, as valid API keys are required for the SDK to communicate with AppBlade. Your API keys are available under the "Reveal your API Keys" link on the main page of your Project.
###Index#
- iOS
- Registration & Setup
- Authorization and Kill Switch
- Update notifications
- Crash Reporting
- Feedback Reporting
- Session Counting
- Custom Parameters <br><br>
- Android
- Registration & Setup
- Authorization and Kill Switch
- Update notifications
- Crash Reporting
- Feedback Reporting
- Session Counting
- Custom Parameters
Registration is required before calling other features in iOS, since we need a Project ID and the other API information to communicate with AppBlade. Calling any other AppBlade function before registering will throw an AppBladeException
telling you which field was left empty or invalid.
Example of such an exception:
*** Terminating app due to uncaught exception 'AppBladeException', reason: 'AppBlade AppBladeKeys not set.
Configure the shared AppBlade manager from within your application delegate or AppBlade plist file.'
That means you'll need to Register and Setup your project with proper project keys from AppBlade, which might mean getting the new SDK installation steps from AppBlade if you're updating from an old SDK.
These sections assume you've already followed through with adding the libAppBladeUniversal.a
Library or the source to your project and you've added AppBlade.h
to your imports. Directions for doing that can be found here.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
AppBlade *blade = [AppBlade sharedManager];
[blade registerWithAppBladePlist];
...
}
Your AppBlade sharedManager
instance then registers itself with the AppBladeKeys.plist which you added via your AppBlade Project page.
Since third-party authentication is prohibited by Apple, and updates are supposed to be handled through the AppStore, this feature will be bypassed automatically if the ipa is signed by Apple. Builds submitted to the AppStore will ignore calls to this method.
###Update notifications# Update notifications check with AppBlade and notify the user if a newer version of the app is available. Unlike the updating that occurs during the `[[AppBlade sharedManager] checkApproval];` call, *anonymous updating* can be done outside the authorization process. Due to this, users will only be notified of new versions when they are running a build downloaded from AppBlade and that version is on the GeneralRelease track.Updating can be called by putting [[AppBlade sharedManager] checkForUpdates];
anywhere in your code, preferably in -application:didFinishLaunchingWithOptions:
or -applicationDidBecomeActive:
.
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Check the app blade update status of this application.
[[AppBlade sharedManager] checkForUpdates];
//Do additional things on resume.
}
Since third-party updating is prohibited by Apple, this feature will be bypassed automatically if the ipa is signed by Apple. Builds submitted to the AppStore will ignore calls to this method.
###Crash Reporting# To register our uncaught crash reporter, call `[[AppBlade sharedManager] catchAndReportCrashes];` after the AppBlade API keys are defined. ###Feedback Reporting# Feedback reporting comes with a dialog prompted by a three-finger double-tap. `[[AppBlade sharedManager] allowFeedbackReporting];` Enables it.To enable feedback reporting without the three-finger double-tap prompt, use [[AppBlade sharedManager] setupCustomFeedbackReporting];
and then prompt the feedback window somewhere in your app with [[AppBlade sharedManager] showFeedbackDialogue]
. We automatically force one feedback window at a time.
Add a call to [[AppBlade sharedManager] logSessionEnd];
under both - (void)applicationWillTerminate:(UIApplication *)application
and - (void)applicationWillResignActive:(UIApplication *)application
in your AppDelegate. If your app is also meant to background for a specific reason, (such as opening a webpage in Safari), you might need to add conditionals to ensure that you're ending sessions appropriately based on how you want your app to work.
Custom parameters are considered unique to every crash or feedback, so you'll have to reenter data that you want to be persistent.
Currently there isn't a limit to how many parameters you can send, or what they can contain, but please don't go too crazy with them. Also, please respect the privacy of the user and only track application details.
<br> <br>
##Android# Our Android SDK is supported in a basic Eclipse environment with the Android Debug Tools installed. The easiest way to do this (if you haven't already) is through the Google [ADT Eclipse plugin](http://developer.android.com/tools/sdk/eclipse-adt.html).You'll need to make a Project on AppBlade first before implementing any of the features, as valid API keys are required for the SDK to communicate with AppBlade. Your API keys are available under the "Reveal your API Keys" link on the main page of your Project.
These sections assume you have already either imported the AppBlade Android source or imported our compiled library into your workspace. Directions for doing that can be found here.
###Registration & Setup# Registration should be called before any other AppBlade function, so naturally you'd want it declared as early in the process as possible. The best way to ensure this is to make a custom Application class (if you don't already have one) and put your registration inside the `onCreate()` method.To register a custom Application class for your Android app, you will need to refer to it by name in the application element of your project's manifest. For example:
<application android:name=".YourApplication">
<activity
android:name="com.yourpackage.YourMainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Then, register your application details in your Application class' onCreate method:
import com.appblade.framework.AppBlade;
import android.app.Application;
public class YourApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
String token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
String secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
String uuid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
String issuance = "9999999999";
AppBlade.register(this, token, secret, uuid, issuance);
}
}
ALSO: Be sure that your application has permission to access the internet to communicate with our server (and store failed requests when it can't) by adding the following permissions to the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
In the end, your AppBlade manifest should look something like this.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourpackagename"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application android:name=".YourApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.yourpackagename.YourMainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
public class MainActivity extends Activity {
public void onResume() {
super.onResume();
AppBlade.authorize(this);
}
}
You'll need to declare our RemoteAuthorizeActivity
among the other activities in your manifest as well, or roll your own Activity. This allows users to sign in through our included webview.
<activity android:name="com.appblade.framework.authenticate.RemoteAuthorizeActivity" />
AppBlade.doFeedback(YourActivity.this);
To also include a screenshot to send to AppBlade with your feedback, include an Activity, a View, or a Bitmap or with one of the following functions:
AppBlade.doFeedbackWithScreenshot(Context context, Activity activity);
AppBlade.doFeedbackWithScreenshot(Context context, View view);
AppBlade.doFeedbackWithScreenshot(Context context, Bitmap bitmap);
A precoded dialog will then prompt the user to fill out a message and an option to send the included screenshot.
###Session Counting# To use Session counting, call `AppBlade.startSession()` and `AppBlade.endSession()` in the `onResume()` and `onPause()` functions of your main `Activity`, respectively. *(Or wherever you think is appropriate. The lifespan of Android apps are notoriously difficult to track, and will vary depending on your implementation.)* ###Custom Parameters# Custom Parameters can be included along with Feedback, Crash reports, and Sessions. Call `AppBlade.setCustomParameter(Context, String, Object)` to set or clear a value to send or call `AppBlade.clearCustomParameters(Context)` to clear all stored variables.*Unlike the iOS implementation of AppBlade, the Android SDK uses persistent custom parameters, so you'll have to manually clear them if you don't want them sent.*