public static string GSIRefreshToken() { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { if (debugLogs) { Debug.Log("LCGoogleLogin: GSIRefreshToken: Always null for android. Check google docs for why so"); } return(LCGoogleLoginAndroid.CallAndroidStringMethod(LCGoogleLoginAndroid.kStrRefreshToken)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { return(LCGoogleLoginiOS.refreshToken()); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: GSIRefreshToken: Unsupported platform"); } } return(null); }
public static bool LoginUser(Action <bool> callback, bool isSilent, bool enableServerAuth = false, bool forceCodeForeRefreshToken = false, List <string> requestedScopes = null) { LCGoogleLoginBridge.SharedInstance(); authCallback = callback; string[] strScopesArray = null; if (requestedScopes == null || requestedScopes.Count <= 0) { strScopesArray = new string[0]; } else { strScopesArray = requestedScopes.ToArray(); } if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidLoginMethod(LCGoogleLoginAndroid.kUserLogin, isSilent, enableServerAuth, forceCodeForeRefreshToken, strScopesArray)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { int noOfScopes = (strScopesArray == null) ? 0 : strScopesArray.Length; return(LCGoogleLoginiOS.userLogin(isSilent, enableServerAuth, forceCodeForeRefreshToken, strScopesArray, noOfScopes)); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: LoginUser: Unsupported platform"); } } return(false); }
public static bool LogoutUser() { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidBoolMethod(LCGoogleLoginAndroid.kUserLogout)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { return(LCGoogleLoginiOS.userLogout()); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: LogoutUser: Unsupported platform"); } } return(false); }
public static string GSIServerAuthCode() { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidStringMethod(LCGoogleLoginAndroid.kStrServerAuthCode)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { return(LCGoogleLoginiOS.serverAuthCode()); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: GSIIDUserToken: Unsupported platform"); } } return(null); }
public static string GSIEmail() { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidStringMethod(LCGoogleLoginAndroid.kStrUserEmail)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { return(LCGoogleLoginiOS.userEmail()); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: GSIPhotoUrl: Unsupported platform"); } } return(null); }
static bool ChangeLoggingDevLevel(bool enabled) { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidInBoolMethod(LCGoogleLoginAndroid.kInBoolChangeDevLogLevel, enabled)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { LCGoogleLoginiOS.changeDevLogLevel(enabled); return(true); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: ChangeLoggingDevLevel: Unsupported platform"); } } return(false); }
public static string[] GSIGrantedScopes() { LCGoogleLoginBridge.SharedInstance(); if (Application.platform == RuntimePlatform.Android) { return(LCGoogleLoginAndroid.CallAndroidStringArrayMethod(LCGoogleLoginAndroid.kStrArrScopes)); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { IntPtr scopesArray = LCGoogleLoginiOS.avalableScopes(); int noScopes = LCGoogleLoginiOS.noOfAvalableScopes(); return(LCGoogleLoginiOS.GetCListFromiOSNativeSentData(scopesArray, noScopes)); } else { if (debugLogs) { Debug.Log("LCGoogleLogin: GSIGrantedScopes: Unsupported platform"); } } return(null); }