2017-12-08 33 views
0

로컬 영수증 유효성 검사를 수행하고 현재 테스트를 수행하려고했습니다. 그러나 애플 영수증 응답에서 잘못된 시간 관련 응답을 받고 있었기 때문에 현재 응용 프로그램을 테스트하기가 어려워졌습니다. 여기 자동 갱신 구독 잘못된 시간 응답 샌드 박스 모드

는 로그 정보입니다 : 여기 enter image description here

내가 영수증 확인을 위해 사용되는 소스 코드 :

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 분의 지속 시간을 가지고 어떻게하면 적절한 테스트를 할 수 있습니까 !!

은 위의 이미지에서 나는이 15시 1분 4초 및이 9시 37분 18초입니다 사과 영수증 응답 시간 내 현지 시간, 두 번 언급합니다. 로컬 장치 수신 확인을 사용 중입니다. 현재 작업을 테스트 할 수 없습니다. 그래서 어떤 방법으로 테스트를 위해 존재합니까 ??

+0

이 문제에 관한 제안 사항은 무엇입니까 ?? 만약 당신이 더 많은 정보를 원한다면 나는 그것을 이용할 수 있습니다. – Siddharth

+0

동일한 문제가 있습니다 : ( –

+0

이 해결책은이 질문에 대한 답변을 만들 수있는 것으로 나타났습니다. – Siddharth

답변

1

위의 문제는 기본적으로 Apple 영수증 응답에 큰 시간차가 있었지만 지금은 이에 대한 해결책을 결론 내 렸습니다. 현지 시간 15시 1분 4초 사과 영수증 응답 시간이에 대한 9시 37분 18초

홈페이지 이유는 GMT 시간 차이입니다. 나는 인도에서 살고 있기 때문에 우리는 5시 30 분 달리기를 가지고있다.

그래서 Apple 수신 시간에 정확한 GMT 시간차를 추가해야 정확한 시간 값을 얻을 수 있으며 이후에는 나머지 코딩을 완료 할 수 있습니다.

아무도 필요하지 않다면 내 Unity 지원 토론과 함께 링크를 게시 할 것입니다.