예제 #1
0
    public void RestorePurchases()
    {
        if (!_IsStoreLoaded)
        {
            SA.Common.Models.Error e = new SA.Common.Models.Error((int)IOSTransactionErrorCode.SKErrorPaymentServiceNotInitialized, "Store Kit Initilizations required");

            IOSStoreKitRestoreResult r = new IOSStoreKitRestoreResult(e);
            OnRestoreComplete(r);
            return;
        }

        OnRestoreStarted();

                #if !UNITY_EDITOR
        IOSNativeMarketBridge.restorePurchases();
                #else
        if (IOSNativeSettings.Instance.SendFakeEventsInEditor)
        {
            foreach (IOSProductTemplate product in Products)
            {
                if (product.ProductType == ISN_InAppType.NonConsumable)
                {
                    ISN_Logger.Log("Restored: " + product.Id);
                    FireProductBoughtEvent(product.Id, "", "", "", true);
                }
            }

            FireRestoreCompleteEvent();
        }
                #endif
    }
예제 #2
0
    /// <summary>
    /// Method for plugin internal use only.
    /// </summary>
    public void GenerateDataLoadFailedEvent(string erorrData)
    {
        var error = new SA.Common.Models.Error(erorrData);
        GK_SaveDataLoaded result = new GK_SaveDataLoaded(error);

        ActionDataLoaded(result);
    }
예제 #3
0
    public void onRestoreTransactionFailed(string array)
    {
        SA.Common.Models.Error e = new SA.Common.Models.Error(array);

        IOSStoreKitRestoreResult r = new IOSStoreKitRestoreResult(e);

        OnRestoreComplete(r);
    }
예제 #4
0
    private void OnInstaPostFailed(string data)
    {
        int code = System.Convert.ToInt32(data);

        SA.Common.Models.Error  error  = new SA.Common.Models.Error(code, "Posting Failed");
        SA.Common.Models.Result result = new SA.Common.Models.Result(error);
        OnInstagramPostResult(result);
    }
    private void VerificationSignatureRetrieveFailed(string array)
    {
        SA.Common.Models.Error error = new SA.Common.Models.Error(array);


        GK_PlayerSignatureResult res = new GK_PlayerSignatureResult(error);

        OnPlayerSignatureRetrieveResult(res);
    }
    //--------------------------------------
    // Hadnlers
    //--------------------------------------


    private void DidFailToRegisterForRemoteNotifications(string errorData)
    {
        var error  = new SA.Common.Models.Error(errorData);
        var result = new ISN_RemoteNotificationsRegistrationResult(error);


        if (_RegistrationCallback != null)
        {
            _RegistrationCallback(result);
        }
    }
예제 #7
0
    //--------------------------------------
    //  EVENTS
    //--------------------------------------


    private void OnStoreKitInitFailed(string data)
    {
        SA.Common.Models.Error e = new SA.Common.Models.Error(data);

        _IsStoreLoaded       = false;
        _IsWaitingLoadResult = false;


        SA.Common.Models.Result res = new SA.Common.Models.Result(e);
        OnStoreKitInitComplete(res);


        if (!IOSNativeSettings.Instance.DisablePluginLogs)
        {
            ISN_Logger.Log("STORE_KIT_INIT_FAILED Error: " + e.Message);
        }
    }
    public IOSImagePickResult(string ImageData) : base()
    {
        if (ImageData.Length == 0)
        {
            _Error = new SA.Common.Models.Error(0, "No Image Data");
            return;
        }


        byte[] decodedFromBase64 = System.Convert.FromBase64String(ImageData);
        _image = new Texture2D(1, 1);
        //	_image = new Texture2D(1, 1, TextureFormat.DXT5, false);
        _image.LoadImage(decodedFromBase64);
        _image.hideFlags = HideFlags.DontSave;

        if (!IOSNativeSettings.Instance.DisablePluginLogs)
        {
            ISN_Logger.Log("IOSImagePickResult: w" + _image.width + " h: " + _image.height);
        }
    }
예제 #9
0
    private void OnUpdateMatchResult(string data)
    {
        string[] DataArray = data.Split(SA.Common.Data.Converter.DATA_SPLITTER);

        GK_TBM_MatchDataUpdateResult result;
        string       matchId = DataArray[0];
        GK_TBM_Match m       = GetMatchById(matchId);

        if (m == null)
        {
            SA.Common.Models.Error e = new SA.Common.Models.Error(0, "Match with id: " + matchId + " not found");
            result = new GK_TBM_MatchDataUpdateResult(e);
        }
        else
        {
            m.SetData(DataArray[1]);
            result = new GK_TBM_MatchDataUpdateResult(m);
        }

        ActionMatchDataUpdated(result);
    }
 public GK_PlayerSignatureResult(SA.Common.Models.Error errro) : base(errro)
 {
 }
 public AN_PackageCheckResult(string packId, SA.Common.Models.Error error) : base(error)
 {
 }
예제 #12
0
 public ISN_CheckUrlResult(string checkedUrl, SA.Common.Models.Error error) : base(error)
 {
     _url = checkedUrl;
 }
    //--------------------------------------
    // Initialize
    //--------------------------------------


    public IOSStoreKitRestoreResult(SA.Common.Models.Error e) : base(e)
    {
    }
 private void OnSendDataError(string errorData)
 {
     SA.Common.Models.Error error = new SA.Common.Models.Error(errorData);
     ActionDataSendError(error);
 }
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    void HandleActionRecordInterrupted(SA.Common.Models.Error error)
    {
        IOSNativePopUpManager.showMessage("Video was interrupted with error: ", " " + error.Message);
    }
 public GK_UserPhotoLoadResult(GK_PhotoSize size, SA.Common.Models.Error error) : base(error)
 {
     _Size = size;
 }
 private void OnMatchFailed(string errorData)
 {
     _CurrentMatch = null;
     SA.Common.Models.Error error = new SA.Common.Models.Error(errorData);
     ActionMatchFailed(error);
 }
예제 #18
0
    //--------------------------------------
    // Initialize
    //--------------------------------------

    public IOSStoreKitResult(string productIdentifier, SA.Common.Models.Error e) : base(e)
    {
        _ProductIdentifier = productIdentifier;
        _State             = InAppPurchaseState.Failed;
    }
 public GK_TBM_MatchDataUpdateResult(SA.Common.Models.Error error) : base(error)
 {
 }
 public GP_AdvertisingIdLoadResult(SA.Common.Models.Error error) : base(error)
 {
 }
예제 #21
0
 public GK_SaveDataLoaded(SA.Common.Models.Error error) : base(error)
 {
 }
예제 #22
0
 public GK_SaveResult(SA.Common.Models.Error error) : base(error)
 {
 }
예제 #23
0
 public GK_LeaderboardResult(GK_Leaderboard leaderboard, SA.Common.Models.Error error) : base(error)
 {
     Setinfo(leaderboard);
 }
 public ISN_RemoteNotificationsRegistrationResult(SA.Common.Models.Error error) : base(error)
 {
 }
예제 #25
0
 private void OnRecordInterrupted(string errorData)
 {
     _IsRecodingAvailableToShare = false;
     SA.Common.Models.Error e = new SA.Common.Models.Error(errorData);
     ActionRecordInterrupted(e);
 }
예제 #26
0
 public ISN_LoadSetLeaderboardsInfoResult(GK_LeaderboardSet lbset, SA.Common.Models.Error error) : base(error)
 {
     _LeaderBoardsSet = lbset;
 }