private void OnLoginCallback(RequestException request, ResponseHelper response) { var statusCode = response.StatusCode; var json = response.Text; LoginCallback?.Invoke(statusCode, json); }
public void TryLogin(string username, string password, LoginCallback callback) { _nc.UserName = username; _nc.Password = password; _loginCallback = callback; _loginVerified = true; Deployment.Current.Dispatcher.BeginInvoke(() => { _loginCallback(true); _loginCallback = null; CoreServices.Instance.SaveLoginInformation(); }); // Removing authentication for now /* * HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.shackchatty.com/auth"); * request.Method = "POST"; * * request.Credentials = _nc; * IAsyncResult token = request.BeginGetResponse(new AsyncCallback(GetLoginCallback), request); * */ }
/// <summary> /// Sends a login request, using given credentials /// </summary> public void LogIn(string username, string password, LoginCallback callback, IClientSocket connection) { LogIn(new Dictionary <string, string> { { "username", username }, { "password", password } }, callback, connection); }
/// <summary> /// Sends a request to server, to log in as a guest /// </summary> public void LogInAsGuest(LoginCallback callback, IClientSocket connection) { LogIn(new Dictionary <string, string>() { { "guest", "" } }, callback, connection); }
public void Login(string email, string password) { var statusCode = 200; var json = string.Empty; LoginCallback?.Invoke(statusCode, json); }
public void Login(string username, string password, LoginCallback scb, ErrorCallback ecb) { RequestData("user/login/?password="******"&username="******"status"]; Status status = Status.FAILURE; if (statusText.ToLower() == "ok") { status = Status.OK; } if (status == Status.OK) { //{"status":"ok","data":{"sessiontoken":"4aa6cbccca2ef5c7eac030af4ddb7bec","userid":111552,"username":"******"}} _sessionToken = (string)root["data"]["sessiontoken"]; int userId = (int)root["data"]["userid"]; string properUsername = (string)root["data"]["username"]; LoggedIn = true; User = new User() { Name = properUsername, UserID = userId }; scb(User); } else { ecb((string)root["message"], null); } }, ecb); }
/// <summary> /// Sends a request to server, to log in as a guest /// </summary> /// <param name="callback"></param> public void LogInAsGuest(LoginCallback callback) { LogIn(new Dictionary <string, string>() { { "guest", "" } }, callback, Connection); }
/** Make a best effort login to the asset store by trying on order: * 1, reuse previously saved session * 2, show login window */ static public void Login(string loginReason, LoginCallback callback) { if (AssetStoreClient.HasActiveSessionID) { AssetStoreClient.Logout(); } // Show login window if we cannot use saved session ID if (!AssetStoreClient.RememberSession || !AssetStoreClient.HasSavedSessionID) { ShowAssetStoreLoginWindow(loginReason, callback); return; } AssetStoreClient.LoginWithRememberedSession(delegate(string errorMessage) { if (string.IsNullOrEmpty(errorMessage)) { callback(errorMessage); } else { ShowAssetStoreLoginWindow(loginReason, callback); } }); }
public void Login(LoginCallback loginCallback) { this.loginCallback = loginCallback; tweeterPinEntryForm.pinCallback = LoginWithPIN; GenerateAuthenticationPIN(appCredentials); tweeterPinEntryForm.ShowDialog(); }
/// <summary> /// Sends a request to server, to log in as a guest /// </summary> public void LogInAsGuest(LoginCallback callback, ErrorCallback errorCallback) { LogIn(new Dictionary <string, string>() { { "guest", "" } }, callback, errorCallback); }
protected void RegisterCallbacks() { OnCaptureDevices += new DevicesCallback(VoiceManager_OnCaptureDevices); OnRenderDevices += new DevicesCallback(VoiceManager_OnRenderDevices); OnConnectorCreated += new ConnectorCreatedCallback(VoiceManager_OnConnectorCreated); OnLogin += new LoginCallback(VoiceManager_OnLogin); }
public static void HandlerLoginResult(LoginCallback callback, Result result) { if (result.code != Result.RESULT_SUCCESS) { return; } if (string.IsNullOrEmpty(result.content)) { return; } LoginWrapperBean <string> wrapperBean = new LoginWrapperBean <string>(result.content); if (wrapperBean.loginCallbackCode == 0) { TDSAccessToken accessToken = new TDSAccessToken(wrapperBean.wrapper); callback.LoginSuccess(accessToken); return; } if (wrapperBean.loginCallbackCode == 1) { callback.LoginCancel(); return; } TDSAccountError error = new TDSAccountError(wrapperBean.wrapper); callback.LoginError(error); }
public void Login(string username, string password, LoginCallback callback) { IsConnected = false; _loginResultCallback = callback; ConnectDoneCallback connectComplete = delegate(bool succ, string msg) { if (succ) { // keep async reading StartReading(); // REAL log in ReqLogin req = new ReqLogin(); req.client = "Quick Arbitrage client"; req.ip = "127.0.0.1"; req.username = username; req.password = password; RequestLogin(req); } else { callback(false, msg); } }; ConnectAsync(new ConnectDoneCallback(connectComplete)); }
private void btLogin_Click(object sender, RoutedEventArgs e) { try { if (Globals.Validator.IsValidShortName(tbLoginName.Text) && Globals.Validator.LoginName_Check(tbLoginName.Text)) { loginUser = Globals.simpleJiraDB.Users.Where(u => u.LoginName == tbLoginName.Text).FirstOrDefault(); if (loginUser != null) { string pwd = SecurePassword.Decrypt(loginUser.PWDEncrypted); if (tbPassword.Password.Equals(pwd)) { LoginCallback?.Invoke(loginUser); this.Close(); new MainWindow(loginUser).ShowDialog(); } else { new MessageBoxCustom("Password Incorrect", MessageBoxCustom.MessageType.Info, MessageBoxCustom.MessageButtons.Ok).ShowDialog(); } } } else { new MessageBoxCustom("User not exist", MessageBoxCustom.MessageType.Info, MessageBoxCustom.MessageButtons.Ok).ShowDialog(); } } catch (SqlException ex) { new MessageBoxCustom("Error Login into system:\n" + ex.Message, MessageBoxCustom.MessageType.Error, MessageBoxCustom.MessageButtons.Ok).ShowDialog(); } }
public void Login(LoginCallback loginCallback)//!!!logincallBack!!! { this.loginCallback = loginCallback; browserform = new BrowserForm(GenerateLoginURL()); browserform.webBrowserCallback = OnUrlOpened; browserform.ShowDialog(); }
/// <summary> /// Sends a login request, using given credentials /// </summary> public void LogIn(string username, string password, LoginCallback callback, ErrorCallback errorCallback) { LogIn(new Dictionary <string, string> { { "username", username }, { "password", password } }, callback, errorCallback); }
/// <summary> /// 登录 /// </summary> /// <param name="userName">用户名</param> /// <param name="password">密码</param> /// <param name="captcha">验证码</param> /// <returns></returns> public async Task <LoginCallback> LoginAsync(string userName, string password, string captcha = "") { string param = $"appkey={BiliFactory.AndroidKey.Appkey}&build={BiliFactory.BuildNumber}&mobi_app=android&password={Uri.EscapeDataString(await BiliFactory.EncryptAsPasswordAsync(password))}&platform=android&ts={BiliFactory.GetNowSeconds()}&username={Uri.EscapeDataString(userName)}"; if (!string.IsNullOrEmpty(captcha)) { param += "&captcha=" + captcha; } param += "&sign=" + BiliFactory.GetSign(param); string response = await BiliClient.PostContentToWebAsync(Api.PASSPORT_LOGIN, param); var result = new LoginCallback(); result.Status = LoginResultType.Error; if (!string.IsNullOrEmpty(response)) { try { var jobj = JObject.Parse(response); int code = Convert.ToInt32(jobj["code"]); if (code == 0) { var data = JsonConvert.DeserializeObject <LoginResult>(jobj["data"].ToString()); var package = new TokenPackage(data.token_info.access_token, data.token_info.refresh_token, BiliFactory.GetTimeStampFuture(data.token_info.expires_in)); InitToken(package); TokenChanged?.Invoke(this, package); result.Status = LoginResultType.Success; await SSO(); await GetUserSpaceAsync(286725648); } else if (code == -2100) { result.Status = LoginResultType.NeedValidate; result.Url = jobj["url"].ToString(); } else if (code == -105) { result.Status = LoginResultType.NeedCaptcha; } else if (code == -449) { result.Status = LoginResultType.Busy; } else { result.Status = LoginResultType.Fail; } } catch (Exception) { return(new LoginCallback { Status = LoginResultType.Fail, Url = "" }); } } return(result); }
public void OnDisable() { if (m_LoginCallback != null) { m_LoginCallback(m_LoginRemoteMessage); } m_LoginCallback = null; m_Password = null; }
public void LoginAsAlbotUser(LoginCallback callback, string username, string password, string clientVersion) { LogIn(new Dictionary <string, string>() { { AlbotDictKeys.username, username }, { AlbotDictKeys.password, password }, { AlbotDictKeys.clientVersion, clientVersion } }, callback, Connection); }
public void RegisterLoginCallback(LoginCallback callback) { Command command = new Command(TDSLoginConstants.TDS_LOGIN_SERVICE, "registerLoginCallback", true, null); EngineBridge.GetInstance().CallHandler(command, (result) => { TDSLoginResultHandler.HandlerLoginResult(callback, result); }); }
public void Login(LoginCallback callback) { #if UNITY_WEBGL if (enableAPI) { _loginAdFunc = callback; login(); } #endif }
/* * public void Login(string username, string password) * { * bool result = false; * Player player = null; * * try * { * using (UNODBEntities db = new UNODBEntities()) * { * try * { * player = db.Players.Where(a => a.username == username && a.password == password).FirstOrDefault(); * } * catch(Exception e) * { * throw e; * } * * if(player != null) * { * if(!IsLogged(player)) * { * result = true; * * player.isLogged = true; * * db.SaveChanges(); * } * else * { * result = false; * throw new PlayerAlreadyLoggedException(resourceManager.GetString("PlayerAlreadyLogged")); * } * }else if(player == null) * { * result = false; * } * } * } * catch(Exception e) * { * throw e; * } * * LoginCallback.LoginVerification(result); * } */ public void Login(string username, string password) { int result = 0; Player player = null; DataManager dataManager = new DataManager(); const int SUCCEDED = 1, INCORRECT_DATA = 2, PLAYER_ALREADY_LOGGED = 3, PLAYER_WITHOUT_VERIFICATION = 4; try { using (UNODBEntities db = new UNODBEntities()) { try { player = db.Players.Where(a => a.username == username).FirstOrDefault(); } catch (Exception e) { throw e; } if (player != null && dataManager.VerifyPassword(password, player.password)) { if (!IsLogged(player)) { if (CheckPlayerVerification(player)) { result = SUCCEDED; player.isLogged = true; db.SaveChanges(); } else { result = PLAYER_WITHOUT_VERIFICATION; } } else { result = PLAYER_ALREADY_LOGGED; } } else { result = INCORRECT_DATA; } } } catch (Exception e) { throw e; } LoginCallback.LoginVerification(result); }
/** Show the login window */ static public void ShowAssetStoreLoginWindow(string loginReason, LoginCallback callback) { AssetStoreLoginWindow w = EditorWindow.GetWindowWithRect <AssetStoreLoginWindow>(new Rect(100, 100, 360, 140), true, "Login to Asset Store"); w.position = new Rect(100, 100, w.position.width, w.position.height); w.m_Parent.window.m_DontSaveToLayout = true; w.m_Password = ""; w.m_LoginCallback = callback; w.m_LoginReason = loginReason; w.m_LoginRemoteMessage = null; }
private IEnumerator LoginCoroutine(string username, string password, LoginCallback callback) { yield return(_login.Login(username, password)); if (_login.UserVerified) { _login.UpdateTime(); } callback(_login.UserVerified); }
/// <summary> /// Connect to the specified url with given username and password. If there /// is already a connecting attempt, does nothing. /// </summary> /// <param name="url">URL of the API.</param> /// <param name="username">Username.</param> /// <param name="password">Password.</param> /// <param name = "callback">Callback function.</param> public void Login(string url, string username, string password, LoginCallback callback) { if (loginCoroutine != null) { return; } apiUrl = url; // We send in username and password. If successful, we are granted a // token which we can use to gain access to editing the map database. loginCoroutine = StartCoroutine(LoginLoop(username, password, callback)); }
public void Login(LoginCallback loginDelegate) { if (!FB.IsLoggedIn) { FB.Login ("", delegate(FBResult result) { if (FB.IsLoggedIn) { loginDelegate (FB.AccessToken); } else { Debug.Log ("Login Facebook Fail!"); } }); } else { loginDelegate (FB.AccessToken); } }
private static void OnLoginResponse(LoginCallback cb, LoginResponse response, ErrorResponse error) { // Store login as local user if (response.responseCode == LoginResponse.ResponseCode.Success) { localUser = new UserAccount(appService, response); appService.SetExceptionUser(localUser); onLoginStatusChangedCB?.Invoke(); } cb(response, error); }
/// <summary> /// Sends a generic login request /// </summary> public void LogIn(Dictionary <string, string> data, LoginCallback callback, IClientSocket connection) { if (!connection.IsConnected) { callback.Invoke(null, "Not connected to server"); return; } _isLogginIn = true; // We first need to get an aes key // so that we can encrypt our login data Msf.Security.GetAesKey(aesKey => { if (aesKey == null) { _isLogginIn = false; callback.Invoke(null, "Failed to log in due to security issues"); return; } var encryptedData = Msf.Security.EncryptAES(data.ToBytes(), aesKey); connection.SendMessage((short)MsfOpCodes.LogIn, encryptedData, (status, response) => { _isLogginIn = false; if (status != ResponseStatus.Success) { callback.Invoke(null, response.AsString("Unknown error")); return; } IsLoggedIn = true; AccountInfo = response.Deserialize(new AccountInfoPacket()); callback.Invoke(AccountInfo, null); if (LoggedIn != null) { LoggedIn.Invoke(); } }); }, connection); }
public void Login(SocialNetwork socialNetwork, LoginCallback loginCallback) { switch (socialNetwork) { case SocialNetwork.Tweeter: { tweeterLoginManager.Login(loginCallback); break; } case SocialNetwork.Facebook: { facebookLoginManager.Login(loginCallback); break; } } }
// 处理异账号的逻辑 private void handleDiifAccount(MSDKBaseRet baseRet) { string methodTag = "异账号"; switch (baseRet.RetCode) { case MSDKError.SUCCESS: { // 本地原有票据有效,使用原有票据登录 // SampleInstance.showRetDialog(methodTag, "使用原有票据登录,游戏无需处理"); LoginCallback.OnLoginSuccess(MSDKLogin.GetLoginRet(), true); break; } case MSDKError.LOGIN_ACCOUNT_REFRESH: { // 新旧 openid 相同,票据不同。刷新登录票据 // SampleInstance.showRetDialog(methodTag, "新旧 openid 相同,票据不同。刷新登录票据,游戏无需处理"); LoginCallback.OnLoginSuccess(MSDKLogin.GetLoginRet(), true); break; } case MSDKError.LOGIN_URL_USER_LOGIN: { // 本地无openid,拉起有票据,使用新票据登录 //SampleInstance.showRetDialog(methodTag, "本地无openid,拉起有票据,使用新票据登录,将自动触发切换游戏账号逻辑(SwitchUser),游戏需监控登录的回调结果"); break; } case MSDKError.LOGIN_NEED_SELECT_ACCOUNT: { // SampleInstance.ShowSwithUserDialog(); LoginCallback.OnSwitchUser(); break; } case MSDKError.LOGIN_NEED_LOGIN: { // SampleInstance.showRetDialog(methodTag, "票据均无效,进入登录页面"); MSDKLoginRet ret = MSDKLogin.GetLoginRet(); LoginCallback.OnLoginFailure(ret.RetCode, ret.RetMsg); } break; default: break; } }
public void Login(IUser tempUser, LoginCallback callback) { var account = new JiraAccount(Properties.Settings.Default.jiraurl, tempUser.Username, tempUser.Password); jiraClient = new JiraClient(account); var mergedCredentials = $"{tempUser.Username}:{tempUser.Password}"; var byteCredentials = Encoding.UTF8.GetBytes(mergedCredentials); var encodedCredentials = Convert.ToBase64String(byteCredentials); OnLoginCallback = callback; using (var webClient = new WebClient()) { webClient.Headers.Set("Authorization", "Basic " + encodedCredentials); webClient.DownloadStringAsync(new Uri(Properties.Settings.Default.jiraurl)); webClient.DownloadStringCompleted += WebClient_DownloadStringCompleted; } }
public static void GoogleLogin(string username, string password, LoginCallback callback, ErrorCallback error) { var data = Encoding.UTF8.GetBytes( "accountType=HOSTED_OR_GOOGLE" + "&Email=" + HttpUtility.UrlEncode(username) + "&Passwd=" + HttpUtility.UrlEncode(password) + "&service=mail" + "&source=gchatapp.com-gchat-" + AppResources.AppVersion ); var req = WebRequest.CreateHttp("https://www.google.com/accounts/ClientLogin"); req.ContentType = "application/x-www-form-urlencoded"; req.Method = "POST"; req.AllowReadStreamBuffering = true; req.Headers["Content-Length"] = data.Length.ToString(); req.BeginGetRequestStream( ar => { using (var requestStream = req.EndGetRequestStream(ar)) { requestStream.Write(data, 0, data.Length); } req.BeginGetResponse( a => { try { var response = req.EndGetResponse(a) as HttpWebResponse; var responseStream = response.GetResponseStream(); using (var sr = new StreamReader(responseStream)) { string line; while ((line = sr.ReadLine()) != null && !line.StartsWith("Auth=")) { } callback(line.Split(new[] { '=' })[1]); } } catch (WebException e) { var response = e.Response as HttpWebResponse; try { using (var responseStream = response.GetResponseStream()) { using (var sr = new StreamReader(responseStream)) { if(error != null) { string errorString = sr.ReadToEnd(); if (errorString.StartsWith("Error=BadAuth")) { error(AppResources.Error_AuthError); } else { error(AppResources.Error_ConnectionErrorMessage); } } } } } catch (Exception) { // What is wrong with this platform?! if(error != null) { error(AppResources.Error_ConnectionErrorMessage); } } } }, null ); }, null ); }
public System.IAsyncResult BeginLogin( System.AsyncCallback callback ) { LoginCallback ftpCallback = new LoginCallback( this.Login); return ftpCallback.BeginInvoke(callback, null); }
public static async Task<OperationResult> Login() { var task = new TaskCompletionSource<OperationResult>(); logBack = new LoginCallback(task.SetResult); var loginCallbackPtr = Marshal.GetFunctionPointerForDelegate( logBack); MessengerInterop.Login(loginCallbackPtr, "*****@*****.**", "12345"); return await task.Task; }
public void TryLogin(string username, string password, LoginCallback callback) { _nc.UserName = username; _nc.Password = password; _loginCallback = callback; _loginVerified = true; Deployment.Current.Dispatcher.BeginInvoke(() => { _loginCallback(true); _loginCallback = null; CoreServices.Instance.SaveLoginInformation(); }); // Removing authentication for now /* HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.shackchatty.com/auth"); request.Method = "POST"; request.Credentials = _nc; IAsyncResult token = request.BeginGetResponse(new AsyncCallback(GetLoginCallback), request); * */ }
public void Login(string email, string password, LoginCallback callback) { var client = new WebClientWithCookies(); var loginHomeUrl = "https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttps://appengine.google.com/start<mpl=ae"; var loginUrl = "https://accounts.google.com/ServiceLoginAuth"; var userRe = new Regex(@"id=""ae-userinfo"">[\s\S]+?<strong>\s*([^\s]+?@[^\s]+?)\s*</strong>"); client.DownloadStringAsync(new Uri(loginHomeUrl)); client.DownloadStringCompleted += (sender, e) => { if (e.Error != null) { callback(false, null); return; } var processHtml = new Action<string>((h) => { if (!userRe.IsMatch(h)) { callback(false, null); return; } int remaining; var remainingMatch = new Regex(@"(\d+) applications remaining").Match(h); if (remainingMatch.Success) { remaining = int.Parse(remainingMatch.Groups[1].Value); } else { remaining = 10; } var appIds = new List<string>(); var noneDeployedAppIds = new List<string>(); var idMatches = new Regex(@"<tr[\s\S]+?&app_id=s~(.+?)""[\s\S]*?</tr>").Matches(h); foreach (Match match in idMatches) { if (!match.Value.Contains("<strong>Disabled")) { var id = match.Groups[1].Value; appIds.Add(id); if (match.Value.Contains("None Deployed")) { noneDeployedAppIds.Add(id); } } } callback(true, new LoginCallbackData() { AppIds = appIds.ToArray(), NoneDeployedAppIds = noneDeployedAppIds.ToArray(), RemainingNumber = remaining }); }); var processLogin = new Action<string>((h) => { var query = initQuery(h); query["Email"] = email; query["Passwd"] = password; query["PersistentCookie"] = "yes"; var cl = new WebClientWithCookies(); cl.UploadValuesAsync(new Uri(loginUrl), query); cl.UploadValuesCompleted += (s, o) => { processHtml(o.Error == null ? Encoding.UTF8.GetString(o.Result) : ""); }; }); var html = e.Result; var userMatch = userRe.Match(html); if (userMatch.Success) { var user = userMatch.Groups[1].Value; if (user.ToLower() == email.ToLower()) { processHtml(html); } else { loginHomeUrl = "https://appengine.google.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://appengine.google.com/start%26service%3Dah"; var cl = new WebClientWithCookies(); cl.DownloadStringAsync(new Uri(loginHomeUrl)); cl.DownloadStringCompleted += (ss, ee) => { if (ee.Error != null) { callback(false, null); } else { processLogin(ee.Result); } }; } } else { processLogin(html); } }; }
// Abre a janela de login do usuario com o Facebook public void login(object state, LoginCallback callback) { if (!Info.HasConnection(true)) return; if (Info.IsWeb()) { Application.ExternalEval("getUserInfo()"); return; } // Criar o codigo de autenticacao string auth = System.Guid.NewGuid().ToString(); // Chama a pagina do Facebook no nosso servidor string fb_login_url = Flow.URL_BASE + "login/facebook/"; fb_login_url += "?app_id=" + Info.appId; fb_login_url += "&authentication=" + auth; fb_login_url += "&device=" + SystemInfo.deviceUniqueIdentifier.Replace("-", ""); if (Save.HasKey(PlayerPrefsKeys.TOKEN.ToString())) fb_login_url += "&token=" + WWW.EscapeURL(Save.GetString(PlayerPrefsKeys.TOKEN.ToString())); string device_push = PushNotifications.getPushDevice(); if (device_push != null) fb_login_url += "&device_push=" + WWW.EscapeURL(device_push); // Up Top Fix Me (dialog) //GameGUI.game_native.openUrlInline(fb_login_url); Flow.game_native.openUrlInline(fb_login_url); // GLA // Obtem a resposta do servidor //GameGUI.components.StartCoroutine(getLoginResult(auth, state, callback)); Flow.config.GetComponent<ConfigManager>().StartCoroutine(getLoginResult(auth, state, callback)); }
public void GetLoginCallback(IAsyncResult result) { try { WebResponse response = ((HttpWebRequest)result.AsyncState).EndGetResponse(result); _loginVerified = true; } catch (Exception) { _nc.Password = ""; _loginVerified = false; } Deployment.Current.Dispatcher.BeginInvoke(() => { _loginCallback(_loginVerified); _loginCallback = null; }); }
// Obtem as informacoes do Facebook no servidor private IEnumerator getLoginResult(string auth, object state, LoginCallback callback) { // Numero maximo de tentativas int max_attempts = 5; WWW conn = null; WWWForm form = new WWWForm(); form.AddField("device", SystemInfo.deviceUniqueIdentifier.Replace("-", "")); form.AddField("authentication", auth); while (max_attempts > 0) { conn = new WWW(Flow.URL_BASE + "login/facebook/fbinfo.php", form); yield return conn; if (conn.error != null || conn.text != "") break; max_attempts--; yield return new WaitForSeconds(1); } if (max_attempts == 0 || conn.error != null) { Debug.LogError("Server error: " + conn.error); yield break; } JSonReader reader = new JSonReader(); IJSonObject data = reader.ReadAsJSonObject(conn.text); if (data == null || data.Contains("error")) { Debug.LogError("Json error: " + conn.text); yield break; } GameToken.save(data); // Verifica se houve erro if (data.Contains("fb_error_reason") && data["fb_error_reason"].ToString() == "user_denied") { // Up Top Fix Me //GameGUI.game_native.showMessage("Error", "You need to authorize our app on Facebook."); // Redireciona para o login caso necessario // Up Top Fix Me //if (Scene.GetCurrent() != GameGUI.components.login_scene) //Scene.Login.Load(Info.firstScene); yield break; } // Salva o token do Facebook Save.Set(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString(), data["fbtoken"].ToString(), true); // Atualiza token da FacebookAPI FacebookAPI facebook = new FacebookAPI(); facebook.UpdateToken(); if (callback != null) callback(state); }
public void authorize(int permissions, LoginCallback cb) { lcb = cb; _authorize(permissions); }