This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Map<String,String> extras = new HashMap<String,String>(); | |
| extras.put("activity","MyActivity"); | |
| extras.put("username","Ventrix"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "client": { | |
| "name": "bugsense-android", // Obligatory | |
| "version": "0.6" | |
| }, | |
| "request": { | |
| "custom_data": { | |
| "key1": "value1", | |
| "key2": "value2" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AndroidJavaObject context; | |
| // get current activity pointer | |
| using (AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | |
| { | |
| context = jc.GetStatic<AndroidJavaObject>("currentActivity"); | |
| } | |
| // start bugsense | |
| using(var BugsenseClass = new AndroidJavaClass("com.bugsense.trace.BugSenseHandler") ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyUnityPlayerActivity extends UnityPlayerActivity | |
| { | |
| protected void onCreate(Bundle savedInstanceState) | |
| { | |
| super.onCreate(savedInstanceState); | |
| BugSenseHandler.setup(this, "12345678"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // If you want to use BugSense for your fork, register with | |
| // them and place your API key in /assets/bugsense.txt | |
| // (This prevents me receiving reports of crashes from forked | |
| // versions which is somewhat confusing!) | |
| try { | |
| InputStream inputStream = getAssets().open("bugsense.txt"); | |
| String key = Utils.ReadInputStream(inputStream); | |
| key=key.trim(); | |
| Log.d("TAG", "Using bugsense key '"+key+"'"); | |
| BugSenseHandler.setup(this, key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String ReadInputStream(InputStream in) throws IOException { | |
| StringBuffer stream = new StringBuffer(); | |
| byte[] b = new byte[4096]; | |
| for (int n; (n = in.read(b)) != -1;) { | |
| stream.append(new String(b, 0, n)); | |
| } | |
| return stream.toString(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @try { | |
| // some exception throwing code | |
| } @catch (NSException *exc) { | |
| BUGSENSE_LOG(exc, @"Tag"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <BugSense-iOS/BugSenseCrashController.h> | |
| // ... | |
| - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| //... | |
| NSDictionary *myStuff = [NSDictionary dictionaryWithObjectsAndKeys:@"myObject", @"myKey", nil]; | |
| [BugSenseCrashController sharedInstanceWithBugSenseAPIKey:@"<Your BugSense API Key>" | |
| userDictionary:myStuff | |
| sendImmediately:NO]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // bugsense parameters (required) | |
| this.defaults = { | |
| apiKey: 'YOUR_API_KEY', // modify me | |
| url: 'http://www.bugsense.com/api/js/errors?api_key=' // NON-SSL | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ajaxError(function(event, xhr, settings, error) { | |
| Bugsense.notify({ | |
| request: xhr, | |
| settings: settings, | |
| error: error | |
| }); | |
| }); |