public void Init() { Debug.Log("InitAnySDK init"); AnySDK.getInstance().init(this.appKey, this.appSecret, this.privateKey, this.oauthLoginServer); Debug.Log("InitAnySDK setListener"); this.anySDKUser = AnySDKUser.getInstance(); this.anySDKUser.setListener(this, "UserExternalCall"); this.anySDKIAP = AnySDKIAP.getInstance(); this.anySDKIAP.setListener(this, "IAPExternalCall"); }
public void Init() { var appKey = _configHolder.AnySDKAppKey; var appSecret = _configHolder.AnySDKAppSecret; var privateKey = _configHolder.AnySDKPrivateKey; var oauthLoginServer = _configHolder.OauthLoginServer; AnySDK.getInstance().init(appKey, appSecret, privateKey, oauthLoginServer); AnySDKUser.getInstance().setListener(this, "UserExternalCall"); AnySDKIAP.getInstance().setListener(this, "IAPExternalCall"); }
public static void Init() { if (!IsInitialized) { GameObject obj = new GameObject(); manager = obj.AddComponent <MINIAnySDKManager>(); // manager = new MINIAnySDKManager(); AnySDK.getInstance().init(appKey, appSecret, privateKey, oauthLoginServer); AnySDKUser.getInstance().setListener(manager, "UserExternalCall"); AnySDKIAP.getInstance().setListener(manager, "IAPExternalCall"); IsInitialized = true; } }
public void Login(Dictionary <string, string> data) { AnySDKUser.getInstance().login(data); }
public void Login() { MyLog.InfoWithFrame(name, "AnySDKManager any sdk login"); AnySDKUser.getInstance().login(); }
void UserExternalCall(string msg) { Debug.Log("UserExternalCall(" + msg + ")"); Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg); int code = Convert.ToInt32(dic["code"]); string result = dic["msg"]; switch (code) { case (int)UserActionResultCode.kInitSuccess: //初始化SDK成功回调 AnySDKUser.getInstance().login(); break; case (int)UserActionResultCode.kInitFail: //初始化SDK失败回调 break; case (int)UserActionResultCode.kLoginSuccess: //登陆成功回调 AnySDKParam param = new AnySDKParam((int)ToolBarPlace.kToolBarBottomLeft); if (AnySDKUser.getInstance().isFunctionSupported("showToolBar")) { AnySDKUser.getInstance().callFuncWithParam("showToolBar", param); } if (AnySDKUser.getInstance().isFunctionSupported("enterPlatform")) { AnySDKUser.getInstance().callFuncWithParam("enterPlatform"); } break; case (int)UserActionResultCode.kLoginNetworkError: //登陆失败回调 case (int)UserActionResultCode.kLoginCancel: //登陆取消回调 case (int)UserActionResultCode.kLoginFail: //登陆失败回调 break; case (int)UserActionResultCode.kLogoutSuccess: //登出成功回调 break; case (int)UserActionResultCode.kLogoutFail: //登出失败回调 break; case (int)UserActionResultCode.kPlatformEnter: //平台中心进入回调 break; case (int)UserActionResultCode.kPlatformBack: //平台中心退出回调 break; case (int)UserActionResultCode.kPausePage: //暂停界面回调 break; case (int)UserActionResultCode.kExitPage: //退出游戏回调 break; case (int)UserActionResultCode.kAntiAddictionQuery: //防沉迷查询回调 break; case (int)UserActionResultCode.kRealNameRegister: //实名注册回调 break; case (int)UserActionResultCode.kAccountSwitchSuccess: //切换账号成功回调 break; case (int)UserActionResultCode.kAccountSwitchFail: //切换账号成功回调 break; case (int)UserActionResultCode.kOpenShop: //应用汇 悬浮窗点击粮饷按钮回调 break; default: break; } }