Last active
October 31, 2016 16:07
-
-
Save jgimenez/f0d42851ccbb23735acb0302e567c32e to your computer and use it in GitHub Desktop.
Unity support for Bugfender
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
using UnityEngine; | |
using System.Collections; | |
public class Bugfender : MonoBehaviour { | |
public string APP_KEY; | |
private static AndroidJavaClass bugfender; | |
// Use this for initialization | |
void Start () { | |
#if UNITY_ANDROID && !UNITY_EDITOR | |
if (bugfender == null) { | |
Debug.Log ("*** INITIALIZING BUGFENDER ***"); | |
using (AndroidJavaClass activityClass = new AndroidJavaClass ("com.unity3d.player.UnityPlayer")) { | |
var activityContext = activityClass.GetStatic<AndroidJavaObject> ("currentActivity"); | |
bugfender = new AndroidJavaClass ("com.bugfender.sdk.Bugfender"); | |
if (bugfender != null) { | |
bugfender.CallStatic ("init", activityContext, APP_KEY, false); | |
bugfender.CallStatic ("enableLogcatLogging"); | |
} | |
} | |
} | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment