示例#1
0
 public List <string> GetAuthMappingList()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
     return(null);
 }
示例#2
0
        public void Login(string providerName, Dictionary <string, object> additionalInfo, int handle)
        {
            GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> providerLoginCallback = (authToken, error) =>
            {
                if (Gamebase.IsSuccess(error) == true)
                {
                    GamebaseIndicatorReport.SetLastLoggedInInfo(providerName, authToken.member.userId);
                    GamebaseIndicatorReport.SendIndicatorData(
                        GamebaseIndicatorReportType.LogType.AUTH,
                        GamebaseIndicatorReportType.StabilityCode.GB_AUTH_LOGIN_SUCCESS,
                        GamebaseIndicatorReportType.LogLevel.INFO,
                        new Dictionary <string, string>()
                    {
                        { GamebaseIndicatorReportType.AdditionalKey.GB_SUB_CATEGORY1, GamebaseIndicatorReportType.SubCategory.LOGIN },
                        { GamebaseIndicatorReportType.AdditionalKey.GB_LOGIN_IDP, providerName },
                        { GamebaseIndicatorReportType.AdditionalKey.GB_CREDENTIAL, JsonMapper.ToJson(additionalInfo) }
                    });
                }
                else
                {
                    GamebaseIndicatorReport.SendIndicatorData(
                        GamebaseIndicatorReportType.LogType.AUTH,
                        GamebaseIndicatorReportType.StabilityCode.GB_AUTH_LOGIN_CANCELED,
                        GamebaseIndicatorReportType.LogLevel.DEBUG,
                        new Dictionary <string, string>()
                    {
                        { GamebaseIndicatorReportType.AdditionalKey.GB_SUB_CATEGORY1, GamebaseIndicatorReportType.SubCategory.LOGIN },
                        { GamebaseIndicatorReportType.AdditionalKey.GB_LOGIN_IDP, providerName },
                        { GamebaseIndicatorReportType.AdditionalKey.GB_CREDENTIAL, JsonMapper.ToJson(additionalInfo) }
                    },
                        error,
                        true);
                }

                var callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> >(handle);

                if (callback != null)
                {
                    callback(authToken, error);
                }

                GamebaseCallbackHandler.UnregisterCallback(handle);
            };

            int providerLoginHandle = GamebaseCallbackHandler.RegisterCallback(providerLoginCallback);

            if (AuthAdapterManager.Instance.IsSupportedIDP(providerName) == false)
            {
                var callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> >(providerLoginHandle);
                GamebaseErrorNotifier.FireNotSupportedAPI(
                    this,
                    callback,
                    string.Format("LoginWithAdditionalInfo({0})", providerName));
                GamebaseCallbackHandler.UnregisterCallback(providerLoginHandle);
                return;
            }

            if (CanLogin(providerLoginHandle) == false)
            {
                return;
            }

            bool hasAdapter = AuthAdapterManager.Instance.CreateIDPAdapter(providerName);

            if (hasAdapter == false)
            {
                var callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> >(providerLoginHandle);
                callback(null, new GamebaseError(GamebaseErrorCode.AUTH_IDP_LOGIN_FAILED, message: GamebaseStrings.AUTH_ADAPTER_NOT_FOUND_NEED_SETUP));
                GamebaseCallbackHandler.UnregisterCallback(providerLoginHandle);
            }

            AuthAdapterManager.Instance.IDPLogin(additionalInfo, (adapterError) =>
            {
                if (Gamebase.IsSuccess(adapterError) == true)
                {
                    var idPAccessToken = AuthAdapterManager.Instance.GetIDPData <string>(providerName, AuthAdapterManager.MethodName.GET_IDP_ACCESS_TOKEN);
                    var requestVO      = AuthMessage.GetIDPLoginMessage(providerName, idPAccessToken);
                    RequestGamebaseLogin(requestVO, providerLoginHandle);

                    return;
                }

                var callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> >(providerLoginHandle);
                if (callback == null)
                {
                    return;
                }

                GamebaseCallbackHandler.UnregisterCallback(providerLoginHandle);
                callback(null, new GamebaseError(GamebaseErrorCode.AUTH_IDP_LOGIN_FAILED, Domain, error: adapterError));
                AuthAdapterManager.Instance.IDPLogout(providerName);
            });
        }
 public GamebaseNetworkType GetNetworkType()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "FireNotSupportedAPI");
     return(GamebaseNetworkType.TYPE_NOT);
 }
 public virtual void ShowWebView(GamebaseRequest.Webview.GamebaseWebViewConfiguration configuration)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "ShowWebView");
 }
 public virtual void ShowAlert(string title, string message, int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.VoidDelegate>(handle));
 }
 public virtual void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
 }
 public string GetCountryCodeOfDevice()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "GetCountryCodeOfDevice");
     return(string.Empty);
 }
示例#8
0
 override public void SetPromotionIAPHandler(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Purchase.PurchasableReceipt> >(handle));
 }
示例#9
0
 public void RequestPurchase(string marketItemId, int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Purchase.PurchasableReceipt> >(handle));
 }
示例#10
0
 public void RequestActivatedPurchases(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <List <GamebaseResponse.Purchase.IapPurchase> > >(handle));
 }
 public void IssueShortTermTicket(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <string> >(handle));
 }
 public virtual void CloseWebView()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "CloseWebView");
 }
 public virtual void ShowWebView(string url, GamebaseRequest.Webview.GamebaseWebViewConfiguration configuration = null, int closeCallback = -1, List <string> schemeList = null, int schemeEvent = -1)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "ShowWebView");
 }
示例#14
0
 public string GetCarrierName()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
     return(string.Empty);
 }
 public string GetLastLoggedInProvider()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "GetLastLoggedInProvider");
     return(string.Empty);
 }
示例#16
0
 public string GetCountryCodeOfUSIM()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
     return(string.Empty);
 }
示例#17
0
 public void RegisterPush(GamebaseRequest.Push.PushConfiguration pushConfiguration, int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.ErrorDelegate>(handle));
 }
 public virtual void ShowAlert(string title, string message)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
 }
示例#19
0
 public void QueryPush(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.GamebaseDelegate <GamebaseResponse.Push.PushConfiguration> >(handle));
 }
 public void ShowToast(string message, GamebaseUIToastType type)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
 }
 public virtual bool IsConnected()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this);
     return(true);
 }
 public void SetSandboxMode(bool isSandbox)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "SetSandboxMode");
 }
 public virtual void IsConnected(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback <GamebaseCallback.DataDelegate <bool> >(handle));
 }
 public string GetNetworkTypeName()
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "GetTypeName");
     return("");
 }
 public void OpenContact(int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, GamebaseCallbackHandler.GetCallback<GamebaseCallback.ErrorDelegate>(handle));
 }