Installation
Cordova plugin is currently supported for iOS and Android platforms. If you use cordova to compile your app for both platforms, you should create separate applications within Bugsee system and obtain separate tokens for your iOS and Android apps. Using cordova-plugin-device you will be able to understard which platform you are running on and use the right token.
Plugin Installation
In the root of your Cordova project run the following command:
cordova plugin add com.bugsee.cordova-plugin --save
# Optional: Install cordova-plugin device if you use both iOS and Android platform
cordova plugin add cordova-plugin-device --save
Initialization
Initialize the Bugsee plugin when your application starts, preferably when the deviceready event fires, e.x:
onDeviceReady: function() {
app.receivedEvent('deviceready');
var appToken = (device.platform == "Android")?"<ANDROID_APP_TOKEN>":"<IOS_APP_TOKEN>";
Bugsee.launch(appToken);
},
Configuration
Bugsee behavior is very customizable, if default configuration is not satisfying your needs you can launch the SDK with additional parameters passed as a dictionary.
... other initialization code
var appToken = (device.platform == "Android")?"<ANDROID_APP_TOKEN>":"<IOS_APP_TOKEN>";
var options = {};
options[Bugsee.Options.ShakeToReport] = true;
options[Bugsee.Options.ScreenshotToReport] = true;
Bugsee.launch(appToken, options);
Available Options
| Key | Default value | Notes |
|---|---|---|
| Bugsee.Options.ShakeToReport | false | Shake gesture to trigger report |
| Bugsee.Options.ScreenshotToReport | true | Screenshot key to trigger report |
| Bugsee.Options.CrashReport | true | Catch and report application crashes (*) |
| Bugsee.Options.MaxRecordingTime | 60 | Maximum recording duration |
* IOS platform allows only one crash detector to be active at a time, if you insist on using an alternative solution for handling crashes, you might want to use this option and disable Bugsee from taking over.