自动续订订阅错误时间响应沙盒模式

悉达多

我目前正在尝试进行本地收据验证并进行测试。但是从苹果收据响应中,我得到了错误的时间相关响应,因此目前我很难测试应用程序。

以下是日志信息: 在此处输入图片说明

这是我用于收据验证的源代码:

 public void CheckIfSubscriptionIsActive(bool validateReceipt)
{
    ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());

    IAppleConfiguration appleConfig = builder.Configure<IAppleConfiguration>();
    bool isSubscriptionRunning = false;

    if (!string.IsNullOrEmpty(appleConfig.appReceipt))
    {
        if (validateReceipt)
        {
            // local receipt verification
            var receiptData = System.Convert.FromBase64String(appleConfig.appReceipt);
            AppleReceipt receipt = new AppleValidator(AppleTangle.Data()).Validate(receiptData);
            foreach (AppleInAppPurchaseReceipt productReceipt in receipt.inAppPurchaseReceipts)
            {

                Debug.Log("# server date: " + GameManager.Instance.ServerDate + " expire date: " + productReceipt.subscriptionExpirationDate);
                int result = DateTime.Compare(GameManager.Instance.ServerDate, productReceipt.subscriptionExpirationDate);
                if (result <= 0)
                {
                    isSubscriptionRunning = true;
                    Debug.Log(" === ==== === Subscription Running: curr date: " + GameManager.Instance.ServerDate + " expire date: " + productReceipt.subscriptionExpirationDate);
                }

                //Debug.Log("PRODUCTID: " + productReceipt.productID);
                //Debug.Log("PURCHASE DATE: " + productReceipt.purchaseDate);
                //Debug.Log("EXPIRATION DATE: " + productReceipt.subscriptionExpirationDate);
                //Debug.Log("CANCELDATE DATE: " + productReceipt.cancellationDate);
            }

            if (isSubscriptionRunning)
                SubscriptionActivated();

            // hide loading...
            showLoader = false;
            Camera.main.SendMessage("ActivateLoadingDialog", false, SendMessageOptions.DontRequireReceiver);

        }
        else
        {
            // server side receipt vecification
            appReceipt = appleConfig.appReceipt;
            StartCoroutine(CheckSubscriptionStatusServerSideVerification());
        }
    }
}

通常每周订阅有 3 分钟的持续时间,所以如果我没有得到确切的时间,那么我该如何进行适当的测试!!

In above image, I have mention both times, my local time is 15:01:04 and apple receipt response time is 09:37:18. Using local device receipt validation at present I can't able to test the work. so what way exist for me for testing??

Siddharth

Basically in above problem, I was getting major time difference in Apple receipt response but now I have concluded the solution for this. local time is 15:01:04 apple receipt response time is 09:37:18

Main reason for this is GMT time difference. I am living in India so we have 5:30 time difference running.

So in Apple receipt time, I require to add this GMT time difference to get exact time values and after this we can complete our rest coding.

如果有人需要,我将在此处发布链接以及我的 Unity 支持讨论。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

PayPal SDK沙盒模式会返回错误链接的响应

来自分类Dev

在沙盒模式下创建PayPal订阅按钮

来自分类Dev

在自动续订订阅上重新购买 ios 中的错误

来自分类Dev

Apple自动续订订阅何时续订?

来自分类Dev

快速自动续订订阅问题

来自分类Dev

SwiftUI自动续订订阅流程

来自分类Dev

沙盒上的付款错误

来自分类Dev

沙盒上的付款错误

来自分类Dev

在沙盒模式下使用TestFlight?

来自分类Dev

PayPal SDK无法进入沙盒模式

来自分类Dev

在沙盒模式下使用TestFlight?

来自分类Dev

使用devise授权omniauth facebook会收到错误“此应用处于沙盒模式”

来自分类Dev

在IFRAME沙盒模式下的Google App脚本中获取错误的网址

来自分类Dev

Braintree:在沙盒模式下使用 CVV 验证创建或更新客户时出现授权错误

来自分类Dev

如何处理自动续订订阅(ios/android)的续订?

来自分类Dev

iOS 7自动续订订阅到期

来自分类Dev

iOS:使用自动续订订阅删除广告

来自分类Dev

如何更新自动续订的订阅收据

来自分类Dev

自动续订订阅和应用收据

来自分类Dev

条带订阅禁用Rails中的自动续订

来自分类Dev

自动续订订阅是否需要还原按钮?

来自分类Dev

IabHelper:检查订阅是否正在自动续订

来自分类Dev

如何激活包月的试用订阅(自动续订)?

来自分类Dev

hmatrix沙盒安装错误问题?

来自分类Dev

沙盒(libsandbox)共享库中的错误

来自分类Dev

使用沙盒帐户的 API 错误

来自分类Dev

公历错误时间

来自分类Dev

在沙盒模式下执行任意C#代码?

来自分类Dev

未收到Paypal Webhook通知-沙盒模式