ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:18.50KB ,
资源ID:6974401      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6974401.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(闲聊sdk接入说明 1.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

闲聊sdk接入说明 1.docx

1、闲聊sdk接入说明 1闲聊SDK接入以下是游戏需求(Ctrl点击进入超链接):需求补充:游戏头像以及昵称按照最先点击登录的类型处理,即先点击哪种登录方式,就以该种登录方式显示。以下是闲聊给出的文档:以下是闲聊给出的demo(在开发过程中闲聊有更换sdk,所以他们的demo仅做参考):以下是河南麻将项目接入文档(并未完全按照闲聊所给文档接入):一、安卓篇1.在Eclipse内导入。2.在android项目内添加(位置为:henmjandroidsrccomhappyplayhnmjsgapi)3.在android项目内添加、三个文件(位置为:henmjandroidsrcorgcocos2dxj

2、avascript)4.在android项目内修改1).添加以下内容. .2).在onCreate函数内添加 public void onCreate(Bundle savedInstanceState) . xianLiaoInit(); etExtras(); if(bundle != null) String msg =(XL_InviteGameInfo); xlInviteGameInfo = msg; (getIntent,getIntent_XL_InviteGameInfo:+msg); .try . (, has xianliao); catch (IOException e

3、) .3).添加函数RunJS_objetjs(name, param);5).添加函数xianLiaoInitpublic void xianLiaoInit() 6) 改微信登录函数wxLogin7)把 req = new (); 改为 req = new 添加函数xianLiaoLogin public void xianLiaoLogin() if(isXLInstall() req = new = none; (req); 8).添加函数isXLInstall9) 加函数doWithoutXLApp10) 加函数xlShareText public void xlShareText(

4、String text) if(isXLInstall()11) 加函数xlShareInviteGame public void xlShareInviteGame(String roomId, String roomToken,String title, String description) if(isXLInstall() Bitmap bitmap = (getResources(),12) 加函数xlShareTexture public void xlShareTexture(String path) if(isXLInstall() Bitmap bitmap = (path)

5、;13) 加函数GetXLInviteGameInfo public void GetXLInviteGameInfo() String rtn_msg = xlInviteGameInfo; if(rtn_msg != ) RunJS_obj(XL_InviteGameInfo,rtn_msg); xlInviteGameInfo = ; 14).添加函数StartXianLiaoLogin public static void StartXianLiaoLogin() if (ccActivity != null) (); 15).添加函数StartShareTextToXL public

6、 static void StartShareTextToXL(String path) if (ccActivity != null) (path); 16).添加函数StartShareInviteGameToXL public static void StartShareInviteGameToXL(String roomId, String roomToken, String title, String description) if (ccActivity != null) (roomId, roomToken, title, description); 17).添加函数StartS

7、hareTextureToXL public static void StartShareTextureToXL(String path) if (ccActivity != null) (path); 18).添加函数xlGetInviteGameInfo public static void xlGetInviteGameInfo() if (ccActivity != null) (); 19).在中添加二、JS篇1.在中修改函数,在函数中添加以下内容 = function () if WX_USER_LOGIN); XL_USER_LOGIN); LoginType); loginDa

8、ta); sendEvent(logout); else (); , , function () WX_USER_LOGIN); XL_USER_LOGIN); LoginType); loginData); sendEvent(logout); (); ); ;2.在中添加函数getWXunionid = function () var unionid = ; var WX_USER_LOGIN = WX_USER_LOGIN); if(WX_USER_LOGIN) WX_USER_LOGIN = (WX_USER_LOGIN); unionid = ; return unionid;3.在

9、中添加函数operateFirstLoginType = function (type) if(!type) var loginType = LoginType); if(loginType) return loginType; else if(type) LoginType, type); return type; else return null; ;4.在中添加函数doInviteGameInfo = function (para) if(!para) return; . if 0) . else . ,6.在中的JSScene的jsBind中添加XL_InviteGameInfo消息

10、XL_InviteGameInfo: function (para) (para); ,7.在中的中添加xlLogin函数 xlLogin: function () try if = , StartXianLiaoLogin, ()V); else if = AppController, sendXLRequest); catch (e) xianLiaoLogin throw: + (e); ,8.在中的中添加xlInviteGame函数 xlInviteGame:function (roomId,roomToken,title,description) try if = , StartSh

11、areInviteGameToXL, (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V, roomId, roomToken, title, description ); else if = AppController, xlShareInvite:AndID:AndTitle:AndText:, roomToken, roomId, title, description ); catch (e) XLInviteGame throw: + (e); ,9.在中的中添加xlShareImage

12、函数 xlShareImage:function () try var writePath = var textrueName = ; if = , StartShareTextureToXL, (Ljava/lang/String;)V, writePath + textrueName ); else if = var writePath = var textrueName = ; AppController, xlShareImage:, writePath + textrueName ); catch (e) XLShareImage throw: + (e); ,10.在中的中添加xl

13、ShareText函数 xlShareText:function (text) try if = , StartShareTextToXL, (Ljava/lang/String;)V, text ); else if = AppController, xlShareText:AndText:, 【四方河南麻将】, text ); catch (e) xlShareText throw: + (e); ,11.在中的中添加xlGetInviteGameInfo函数 xlGetInviteGameInfo:function () . try if = , xlGetInviteGameInfo,

14、 ()V); else if = AppController, xlGetInviteGameInfo); catch (e) xlGetInviteGameInfo throw: + (e); ,12.在中添加变量xlLoginPara = ;13.在中的f_login函数中添加: if = ; = ; = ; = ; 14.在中修改函数autoLogin = function () (); var type = (); var beginLogin = false; mylog(判断是否可以进行闲聊或者微信的自动登录 type: + type); if (type = wx) mylog(

15、开始进行微信自动登录.); var WX_USER_LOGIN = WX_USER_LOGIN); if (WX_USER_LOGIN) mylog(微信自动登录.); WX_USER_LOGIN = (WX_USER_LOGIN); LoginAsWeChat(WX_USER_LOGIN); beginLogin = true; else if (type = xl) mylog(开始进行闲聊自动登录.); var XL_USER_LOGIN = XL_USER_LOGIN); if (XL_USER_LOGIN) mylog(闲聊自动登录.); XL_USER_LOGIN = (XL_US

16、ER_LOGIN); .); loginData = loginData); if (loginData) mylog(loginData自动登录.); loginData = (loginData); f_login, ; beginLogin = true; .); + , function (er, txt) if (txt) .); f_login(xlLoginPara); ); ,15.在中_event内添加XL_LOGIN_MSG的事件响应 XL_LOGIN_MSG:function (para) if switch case ERR_SUCCESS: . . else if =

17、 . ,16.在中的邀请按钮的点击事件中添加:wxinvite: . _click: function () . . ,17.在中添加:var XianLiaoType = text:1, . , _click: function () (); 18.在的ShareWXLayer中的_event添加XL_USER_LOGIN XL_USER_LOGIN:function (para) (); if(para) .); ;1.在中handleOpenURL函数中修改- (BOOL)application:(UIApplication *)application handleOpenURL:(NS

18、URL *)url .); std:string result_c_str= ; if (callBackType = SugramLoginSuccessType) result_c_str = errMsg:ERR_SUCCESS; else if (callBackType = SugramLoginCancelType) result_c_str = errMsg:ERR_CANCEL; else if(callBackType = SugramLoginErrorType) result_c_str = errMsg:ERR_FAIL; else if(callBackType =

19、SugramLoginUnkonwType) result_c_str = errMsg:ERR_UNKNOW; dispatch_async(dispatch_get_main_queue(), std:string event = XL_LOGIN_MSG; std:string funName = ; std:string rStr = funName + ( + event + , + result_c_str + ); NSString *printStr = NSString stringWithCString:() encoding:NSString defaultCString

20、Encoding; NSLog(printStr:%,printStr); ScriptingCore:getInstance()-evalString(); ); NSLog(闲聊登录结果结束.);2.在中添加函数xlErrorAfterGetCode+(void)xlErrorAfterGetCode NSLog(闲聊在获取code之后的其他操作失败.); std:string result_c_str = errMsg:ERR_AFTERGETCODE; dispatch_async(dispatch_get_main_queue(), std:string event = XL_LOG

21、IN_MSG; std:string funName = ; std:string rStr = funName + ( + event + , + result_c_str + ); NSString *printStr = NSString stringWithCString:() encoding:NSString defaultCStringEncoding; NSLog(printStr:%,printStr); ScriptingCore:getInstance()-evalString(); );3.在中添加函数xlShareMSG+(void)xlShareMSG:(Sugra

22、mShareCallBackType)callBackType NSLog(闲聊分享结果.); std:string result_c_str= ; if (callBackType = SugramShareSuccesslType) result_c_str = errMsg:ERR_SUCCESS; else if(callBackType = SugramShareCancelType) result_c_str = errMsg:ERR_CANCEL; else if(callBackType = SugramShareErrorType) result_c_str = errMsg

23、:ERR_FAIL; else if(callBackType = SugramShareUnkonwType) result_c_str = errMsg:ERR_UNKNOW; dispatch_async(dispatch_get_main_queue(), std:string event = XL_SHARE_MSG; std:string funName = ; std:string rStr = funName + ( + event + , + result_c_str + ); NSString *printStr = NSString stringWithCString:(

24、) encoding:NSString defaultCStringEncoding; NSLog(printStr:%,printStr); ScriptingCore:getInstance()-evalString(); ); NSLog(闲聊分享结果结束.);4.在中添加函数xlGetInviteGameInfo+(void)xlGetInviteGameInfo NSLog(查询闲聊查询游戏邀请信息.); NSString *inviateMsgStr1 = NSString stringWithCString:() encoding:NSString defaultCStringEncoding; NSLog(inviateMsgStr:% len=%lu,inviateMsgStr1,(); if() 0) dispatch_async(dispatch_get

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1