腾讯MSDK for Unity
发布日期:2021-06-30 19:38:04 浏览次数:4 分类:技术文章

本文共 2429 字,大约阅读时间需要 8 分钟。

首先下载官方MSDK for unity

创建一个GameObject并命名为Msdk,它将作为MSDK回调物体

bugly上报模块

初始化

void InitBugly() 	{		// 开启SDK的调式开关        		Bugly.EnableLog (true);		// 设置C#堆栈日志捕获的级别,默认为Exception,可以选择为Assert、Error等		Bugly.RegisterHandler (LogSeverity.Exception);				// 如果你已经在Unity项目导出的Android或iOS工程中进行了SDK的初始化,则只需调用此方法完成C#堆栈捕获功能的开启		Bugly.EnableExceptionHandler();	}
回调

using com.tencent.bugly.unity3d;public class BuglyInit : MonoBehaviour {    // this is for iOS    public string BuglyAppIdForIOS = "";    public string BuglyAppChannelForIOS = "";    public string BuglyAppVersionForIOS = "";    //public bool AutoThrow = true;        // this will be config by editor    public string GameObjectForCallback = "";    public bool DebugEnable = false;    public LogSeverity LogLevel = LogSeverity.Exception;        // this is for android    public string BuglyAppIdForAndroid = "";    public string AppVersionForAndroid = "";    public string AppChannelForAndroid = "";    public string ReportDelayTimeForAndroid = "";        void Awake ()    {        DontDestroyOnLoad (this.gameObject);                Debugger.setDebugLevel(LogSeverity.Log);                Bugly.SetGameObjectForCallback (GameObjectForCallback);        Bugly.EnableLog (DebugEnable);        Bugly.RegisterHandler (LogLevel);                #if UNITY_IPHONE        Bugly.SetAppVersion (BuglyAppVersionForIOS);        Bugly.SetChannel (BuglyAppChannelForIOS);        Bugly.InitSDK (BuglyAppIdForIOS);                Bugly.SetGameObjectForCallback("Bugly");        Bugly.SetCrashHappenCallback ("_callbackCrashHappen");        #endif                      #if UNITY_ANDROID        Bugly.SetAppVersion (AppVersionForAndroid);        Bugly.SetChannel (AppChannelForAndroid);        Bugly.SetReportDelayTime(ReportDelayTimeForAndroid);        Bugly.InitSDK (BuglyAppIdForAndroid);        #endif    }        void _callbackCrashHappen(string data){        Debugger.Debug ("on crash callback");        if (data != null) {            Debugger.Info("receive message :" + data);                  }    }}
手Q微信授权登陆

接口

WGPlatform.Instance.WGLoginQQ ();
WGPlatform.Instance.WGLoginWX ();
回调

void OnLoginNotify(string jsonRet)
查询个人信息
接口

WGPlatform.Instance.WGQueryMyQQInfo ();

WGPlatform.Instance.WGQueryMyWXInfo();
回调

void OnRelationNotify(string jsonRet)
同玩好友信息

接口

WGPlatform.Instance.WGQueryQQGameFriendsInfo ();
WGPlatform.Instance.WGQueryWXGameFriendsInfo();
回调

void OnRelationNotify(string jsonRet)

转载地址:https://linxinfa.blog.csdn.net/article/details/46760129 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:关于MSDK的几个难点
下一篇:腾讯MSDK手Q微信授权登录

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年05月02日 06时35分53秒