示例#1
0
    public void InitBuglyAgent()
    {
        string AppKey_ios;
        string AppKey_Android;

        if (DebugConfigController.Instance.FormalData)
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidFormal;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosFormal;
        }
        else
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidTest;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosTest;
        }
        // 开启SDK的日志打印,发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(false);
        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        if (DebugConfigController.Instance._Debug)
        {
            BuglyAgent.RegisterLogCallback(LogCallback);
        }


#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(AppKey_ios);
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(AppKey_Android);
#endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();

        //Application.logMessageReceivedThreaded += LogCallback;
    }
示例#2
0
    void Awake()
    {
        // Enable the debug log print
        BuglyAgent.ConfigDebugMode(false);
        // Config default channel, version, user
        BuglyAgent.ConfigDefault(null, null, null, 0);
        // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
        // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
        BuglyAgent.ConfigAutoQuitApplication(false);
        // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
        BuglyAgent.RegisterLogCallback(null);

        // Init the bugly sdk and enable the c# exception handler.
        BuglyAgent.InitWithAppId(BuglyAppID);

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        BuglyAgent.SetLogCallbackExtrasHandler(MyLogCallbackExtrasHandler);

        Destroy(this);
    }
        static void InitBugly()
        {
            if (Application.isEditor)
            {
                return;
            }

            // Enable the debug log print
            BuglyAgent.ConfigDebugMode(enable: Config.enableDebug);
            // Config default channel, version, user
            BuglyAgent.ConfigDefault(channel: Config.store, $"{Config.versionName}-{Config.versionCode}",
                                     user: UserInfoManager.getUserInfo().userId ?? "anonymous", 0);
            // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
            BuglyAgent.ConfigAutoReportLogLevel(level: LogSeverity.LogWarning);
            // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
            BuglyAgent.ConfigAutoQuitApplication(false);
            // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
            BuglyAgent.RegisterLogCallback(null);

            // Init the bugly sdk and enable the c# exception handler.
            BuglyAgent.InitWithAppId(appId: Config.buglyId);

            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
        }
示例#4
0
 static public int EnableExceptionHandler_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         BuglyAgent.EnableExceptionHandler();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
示例#5
0
    void InitBuglySDK()
    {
        Debug.Log("InitBuglySDK");
        // TODO NOT Required. Set the crash reporter type and log to report
        // BuglyAgent.ConfigCrashReporter (1, 2);
#if DEBUG
        // 开启SDK的日志打印, 发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(true);
#endif
        // TODO NOT Required. Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

        // BuglyAgent.ConfigDefault ("Bugly", null, "ronnie", 0);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(BuglyAppIDForiOS);
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(BuglyAppIDForAndroid);
#endif

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        // BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");
    }
示例#6
0
    void Awake()
    {
        luaenv = new LuaEnv();
        gameObject.AddComponent <OutLog>();
        Mono = gameObject.AddComponent <emptyMono>();
        Application.targetFrameRate = AppConst.lockFrame;
#if ISDEBUG
        //gameObject.AddComponent<TestConsole>();
        m_LastUpdateShowTime = Time.realtimeSinceStartup;
#endif

        #region bugly
        //开启SDK的日志打印,发布版本请务必关闭
#if ISDEBUG
        BuglyAgent.ConfigDebugMode(true);
#else
        BuglyAgent.ConfigDebugMode(false);
#endif
        //注册日志回调,替换使用'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        BuglyAgent.RegisterLogCallback(OutLog.HandleLog);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("Your App ID");
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("7599ce92e1");
#endif
        //如果你确认已在对应的ios工程或Andoird工程初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
        #endregion

        EventManager.instance.RegistEvent(NetEventType.OnSetUpdateWindowTipTxt, SetUpdateTipText);
    }
示例#7
0
 private void InitBugly()
 {
     BuglyAgent.ConfigDebugMode(SystemConfig.IsBuglySDKLogOn);
     BuglyAgent.ConfigDefault(SDKManager.Instance.GetSDKName(), this.GetLocalVersionsString(), SystemInfoTools.GetDeviceName(), 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.InitWithAppId("900057844");
     BuglyAgent.EnableExceptionHandler();
 }
示例#8
0
    /// <summary>
    /// 初始化bugly
    /// </summary>
    public void InitBuglySDK()
    {
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS
        // TODO NOT Required. Set the crash reporter type and log to report
        // BuglyAgent.ConfigCrashReporter (1, 2);

        // TODO NOT Required. Enable debug log print, please set false for release version
#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#endif
        //BuglyAgent.ConfigDebugMode(true);
        // TODO NOT Required. Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

        // BuglyAgent.ConfigDefault ("Bugly", null, "ronnie", 0);

#if UNITY_IPHONE || UNITY_IOS
        if (Const.Region == RegionType.CHINA)
        {
            var channel = string.Format("{0}_{1}", GlobalConfig.Instance.Channel, GlobalConfig.Instance.SubChannel);

            BuglyAgent.ConfigDefault(channel, null, null, 0);
            BuglyAgent.InitWithAppId("d47e3e83c9");
        }
        else if (Const.Region == RegionType.HKTW)
        {
            BuglyAgent.InitWithAppId("af2d9108c7");
        }
        else if (Const.Region == RegionType.KOREA)
        {
            BuglyAgent.InitWithAppId("c5ab48ff08");
        }
        else if (Const.Region == RegionType.SEASIA)
        {
            BuglyAgent.InitWithAppId("9baaf461f1");
        }
        // iOS工程启动初始化
#elif UNITY_ANDROID
        // BuglyAgent.InitWithAppId ("900036622");
        // android工程启动初始化
#endif

        //BuglyAgent.SetUserId();
        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // If you need to report extra data with exception, you can set the extra handler
        //BuglyAgent.SetLogCallbackExtrasHandler(LogCallbackExtrasHandler);



        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");
        LogExtraInfo();
#endif
    }
示例#9
0
 private static void Bugly_Init()
 {
     BuglyAgent.ConfigDebugMode(false);
     BuglyAgent.ConfigDefault(null, null, null, 0L);
     BuglyAgent.ConfigAutoReportLogLevel(5);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.RegisterLogCallback(null);
     BuglyAgent.InitWithAppId("8c142b9f46");
     BuglyAgent.EnableExceptionHandler();
 }
示例#10
0
        public static void Init()
        {
#if UNITY_ANDROID
            BuglyAgent.ConfigCrashReporter(1, 1);
#endif
            BuglyAgent.ConfigDebugMode(MSDK.isDebug);
            BuglyAgent.EnableExceptionHandler();

            MSDKLog.Log("InitCrash of Bugly finished");
        }
示例#11
0
        private void initBugly()
        {
            GuLog.Debug("initBugly");
            BuglyAgent.ConfigDebugMode(true);

#if UNITY_ANDROID
            BuglyAgent.InitWithAppId("fced1ab5e5");
#endif
            BuglyAgent.EnableExceptionHandler();
        }
示例#12
0
    public void Init()
    {
        BuglyAgent.ConfigDebugMode(true);
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogWarning);
        BuglyAgent.ConfigDefault(channel, "", "", 0);
        BuglyAgent.InitWithAppId(appId);//初始化


        // BuglyAgent.SetUserId(Config.UserId);

        BuglyAgent.EnableExceptionHandler();//启动异常上报
    }
示例#13
0
 private void Awake()
 {
     BuglyAgent.ConfigDebugMode(false);
     BuglyAgent.ConfigDefault(null, null, null, 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.RegisterLogCallback(null);
     BuglyAgent.InitWithAppId("YOUR APP ID GOES HERE");
     BuglyAgent.EnableExceptionHandler();
     BuglyAgent.SetLogCallbackExtrasHandler(new Func <Dictionary <string, string> >(BuglyInit.MyLogCallbackExtrasHandler));
     UnityEngine.Object.Destroy(this);
 }
示例#14
0
    public static void SetupBugly()
    {
        //初始化Bugly
        BuglyAgent.ConfigDebugMode(true);
#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("900059347");
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("900059341");
#endif
        BuglyAgent.EnableExceptionHandler();
        //
        //end Bugly
    }
示例#15
0
    void Start()
    {
#if   UNITY_IOS
        BuglyAgent.InitWithAppId("your ios app id");
#elif UNITY_ANDROID
        //GamePlayerActivity已初始化,此处不需要再调用。
#endif

        BuglyAgent.ConfigDebugMode(false);
        BuglyAgent.EnableExceptionHandler();

        Test();
    }
示例#16
0
        static int _m_EnableExceptionHandler_xlua_st_(RealStatePtr L)
        {
            try {
                {
                    BuglyAgent.EnableExceptionHandler(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
    private void Bugly_Init()
    {
        // 开启SDK的日志打印,发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(true);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("8ec9139b10");
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("085dd1eab0");
#endif

        //如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
    }
示例#18
0
    private void InitBuglySDK()
    {
        BuglyAgent.ConfigDebugMode(false);
        BuglyAgent.InitWithAppId("004e85ad39");

        BuglyAgent.EnableExceptionHandler();
        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");

        // set tag
#if UNITY_ANDROID
        BuglyAgent.SetScene(3450);
#else
        BuglyAgent.SetScene(3261);
#endif
    }
示例#19
0
    void InitBuglySDK()
    {
        // 开启SDK的日志打印,发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(true);
        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("f71aaa33e2");
                #elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("Your App ID");
                #endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
    }
示例#20
0
文件: Main.cs 项目: linxscc/LoveGame
    private void Awake()
    {
        BuglyAgent.EnableExceptionHandler();

        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);

        BuglyAgent.RegisterLogCallback(OnBuglyLogCallback);

        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        Application.targetFrameRate = 30;

        EventDispatcher.AddEventListener <bool>(EventConst.ForceToLogin, ForceToLoginView);

        Application.lowMemory += OnLowMemory;
    }
示例#21
0
    private void Awake()
    {
        this._interface = new JoyYouSDK();
        BuglyAgent.ConfigDebugMode(false);
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            BuglyAgent.InitWithAppId("i1105309683");
            break;

        case RuntimePlatform.Android:
            BuglyAgent.InitWithAppId("1105309683");
            break;
        }
        BuglyAgent.EnableExceptionHandler();
    }
示例#22
0
    void InitBuglySDK()
    {
        // enable debug log print
        BuglyAgent.ConfigDebugMode(true);
        // Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("900001055");
                #elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("900001191");
                #endif

        // If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();
    }
示例#23
0
    // Use this for initialization
    void Awake()
    {
        Application.targetFrameRate = 60;
        var external = External.Instance;

        // 事件监听
        registerEvents();

        debugSetup();

        BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("b3d868488f");
                #endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
    }
示例#24
0
        public void Awake()
        {
            if (Instance == null)
            {
                Log.Debug("bugly sdk init");
                Instance = this;
                if (Application.isEditor)
                {
                    isRuntime = false;
                    return;
                }
#if DEBUG
                //BuglyAgent.ConfigDebugMode(true);
#endif
                //logcall = RegisterCallBack;
                //BuglyAgent.RegisterLogCallback(logcall);
                BuglyAgent.ConfigDefault(channel, Application.version, Application.productName, 0);

                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    if (GlobalData.Instance.serverType == 2)
                    {
                        BuglyAgent.InitWithAppId("1bef60b664");//正式服
                    }
                    else if (GlobalData.Instance.serverType == 1)
                    {
                        BuglyAgent.InitWithAppId("809b83eaa2");//测试服
                    }
                }
                else if (Application.platform == RuntimePlatform.Android)
                {
                    if (GlobalData.Instance.serverType == 2)
                    {
                        BuglyAgent.InitWithAppId("b15be2578e");//正式服
                    }
                    else if (GlobalData.Instance.serverType == 1)
                    {
                        BuglyAgent.InitWithAppId("02cceece35");//测试服
                    }
                }
                BuglyAgent.EnableExceptionHandler();
                BuglyAgent.PrintLog(LogSeverity.LogInfo, "bugly sdk init");
            }
        }
示例#25
0
    protected void Awake()
    {
        try {
            string uid = PlayerPrefs.GetString("PlayerPrefs_Login_USERID", "0");
            if (PlayerPrefs.GetInt("PlayerPrefs_OpenDevelopmentMode", 0) != 0)
            {
                uid += "_test";
            }
            BuglyAgent.ConfigDefault("DHQPYX", Application.version, uid, 0);
        } catch (System.Exception ex) {
            Debug.LogException(ex);
        }
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("b84a162675");
                #elif UNITY_ANDROID
//		    BuglyAgent.InitWithAppId ("331505691e");
        BuglyAgent.EnableExceptionHandler();
                #endif

#if !UNITY_EDITOR
        GameConfigProject.instance.assetLoadType = 1;
        GameConfigProject.instance.testView      = false;
#else
        if (GameConfigProject.instance.testView)
        {
            return;
        }
#endif
        GameObject gameRoot = GameObject.Find("GameRoot");
        if (!GameConfigProject.instance.testView && gameRoot != null)
        {
            gameRoot.name = "GameRootNeedDestroy";
            gameRoot.SetActive(false);
            Destroy(gameRoot);
        }
        if (!ClearPersistentExpireAssets())
        {
            ClearPersistentExpireAssets();
        }
        new LuaLoader();
        base.Awake();
    }
示例#26
0
        public void init(TyCrashReport.initInfo info)
        {
            // enable debug log print
            BuglyAgent.ConfigDebugMode(info._debuglogprint);
            // Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
            //BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
            BuglyAgent.RegisterLogCallback(null);
            BuglyAgent.ConfigDefault(info._channel, info._ver, info._user, 0);

#if UNITY_IPHONE || UNITY_IOS
            BuglyAgent.InitWithAppId(info._appId_IOS);
#elif UNITY_ANDROID
            BuglyAgent.InitWithAppId(info._appId_Android);
#endif

            // If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
        }
示例#27
0
 private void Awake()
 {
     if (Application.platform == RuntimePlatform.Android && !this.androidEnable)
     {
         return;
     }
     if (Application.platform == RuntimePlatform.IPhonePlayer && !this.iosEnable)
     {
         return;
     }
     BuglyAgent.ConfigCrashReporter(1, 1);
     BuglyAgent.ConfigDebugMode(true);
     BuglyAgent.ConfigDefault(string.Empty, GlobalSettings.Instance.versionConfig.appVersion, "10000", 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(true);
     BuglyAgent.RegisterLogCallback(new BuglyAgent.LogCallbackDelegate(CallbackDelegate.Instance.OnApplicationLogCallbackHandler));
     BuglyAgent.InitWithAppId("900016162");
     BuglyAgent.SetScene(3450);
     BuglyAgent.EnableExceptionHandler();
 }
示例#28
0
        public void Init()
        {
            string logVersion = "MSDK Unity Version : " + WGPlatform.Version;

            MsdkUtil.Log(logVersion);
            WGPlatform.Instance.WGBuglyLog(eBuglyLogLevel.eBuglyLogLevel_D, logVersion);

            MessageCenter.Instance.Init();
            WGPlatform.Instance.WGSetPermission(ePermission.eOPEN_ALL);
            BuglyAgent.ConfigCrashReporter(2, 4);
            // NOT Required. Enable debug log print, please set false for release version
            BuglyAgent.ConfigDebugMode(false);
            // Setting report level
            BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
            // Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
            // NOT Required. If you need to report extra data with exception, you can set the extra handler
            // 只在iOS的C#异常时会触发
            //BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);
        }
示例#29
0
    void InitBuglySDK()
    {
        if (AppConst.LuaByteMode)
        {
            BuglyAppIDForiOS     = "ec087313d2";
            BuglyAppIDForAndroid = "0f2d24b14a";
        }
        else
        {
            BuglyAppIDForiOS     = "37df5c565c";
            BuglyAppIDForAndroid = "d41a27b748";
        }


#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#endif
        BuglyAgent.ConfigDebugMode(true);
        // TODO NOT Required. Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

        // BuglyAgent.ConfigDefault ("Bugly", null, "ronnie", 0);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(BuglyAppIDForiOS);
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(BuglyAppIDForAndroid);
#endif

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        //        BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");
    }
示例#30
0
    public void Init()
    {
                #if UNITY_EDITOR
        sdk = new EditorSDK();
        BuglyAgent.ConfigDebugMode(true);
                #elif UNITY_ANDROID
        //sdk = new EditorSDK();
        sdk = new AndroidSDK();
        BuglyAgent.ConfigDebugMode(false);
        //BuglyAgent.InitWithAppId ("79668fd96a");
                #elif UNITY_IPHONE
        sdk = new IosSDK();
        BuglyAgent.ConfigDebugMode(false);
        BuglyAgent.InitWithAppId("0d4290d8fc");
        #endif
        BuglyAgent.EnableExceptionHandler();
        sdk.Init();

        if (!Main.Instance.UserManager.HasUserId())
        {
            GetDeviceID();
        }
    }