iOS: Subscription Issues



  • My app with subscription on Android works perfectly.
    I have some questions about iOS.

    Restoring

    My Testing shows that Successful Restoring means that just operation of restoring was executed. Tell me if I correctly understand:

    1.Successful Restoring doesn't mean that concrete purchase was restored.

    2.Also, Successful Restoring doesn't mean that there is previous purchase or active/not active subscription.

    --

    3.Also, If I click "Subscribe" after Restoring without active subscription then I have

    IAPManager reports: PurchaseFailed. Error: DuplicateTransaction
    

    Why & How to handle it?

    Next click (2nd) on "Subscribe" will show iOS Payment Sheet already & there is no problem.



  • Restoring on iOS means calling Unity IAP's GetExtension<IAppleExtensions> ().RestoreTransactions method as per official documentation:

    https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html

    During this process the ProcessPurchase method of your IStoreListener will be invoked for any items the user already owns.

    The ProcessPurchase callbacks can happen between, or after the RestoreTransactions callback. RestoreTransactions retrieves the "App Receipt" from the App Store. See this page for a description and link to the Apple documentation:

    https://docs.unity3d.com/Manual/UnityIAPPurchaseReceipts.html

    An App Receipt can have multiple products in it, as well as valid and expired subscription transactions. Basically, everything the user has ever purchased is stored in there. In Simple IAP System,

    • restoring on iOS should set all non-consumable products to purchased in the app
    • restoring on iOS while using the ReceiptValidatorServer script should set all currently active subscriptions to purchased

    I am in the process of testing this again and also doing a test of your point 3. using Unity 2018.4 / iOS 12.4 / XCode 12.0.1. Unfortunately using Unity IAP 2.0 I am running into the "purchase always fails as Unknown" issue mentioned on the forum. I'll have to somehow downgrade Unity IAP first.



  • Thanks for links, for 1-2 the answer in code comment here:

    extensions.GetExtension<IAppleExtensions> ().RestoreTransactions (result => {
            if (result) {
                // This does not mean anything was restored,
                // merely that the restoration process succeeded.
            } else {
                // Restoration failed.
            }
        });
    
    

    So then what is restoration failing?

    P.S.
    For Point 3 — My environment is:

    • Unity IAP 1.23.5
    • Unity 2019.4.10
    • SIS 4.3.5
    • iOS 14.0.1 (iPhone XS Max)
    • XCode 12.0.1


  • Finally I was able to run a test build using the settings above, as Apple / Unity might have fixed the 'Unknown' error (thread on the Unity forums linked above).

    So then what is restoration failing?

    Restoration requires entering the user's Apple ID and password. An incorrect password, or general authentification errors on Apple's servers could fail the restoration process.

    3.Also, If I click "Subscribe" after Restoring without active subscription then I have IAPManager reports: PurchaseFailed. Error: DuplicateTransaction

    I was not able to reproduce this reliably. I saw the error once, when a subscription renewal period was still active. Resubscribing then showed the "there is an active subscription, you can manage it in your account" popup. Returning to the app and pressing buy a few times more resulted in the error, since there still was an active subscription at that time. Later after the subscription periods passed, restoring purchases (none) and purchasing a new subscription did not show the error, the outcome was as expected.



  • @Baroni OK, as I understand you can't do anything while Unity/Apps will fix it (point 3), but I have not "Unknow Error", I have "DuplicateTransaction".
    So we just have to wait?

    I read Unity Dev message right before your message and he said: "There is an increase in both errors in recent IAP releases, and we are working to determine the cause."

    So I am on 1.23.5 for now.

    Thanks for clarification about restoration failing. It's helpful.


    Let's take a look on another issues:

    4_.Unlike Google, Apple doesn't send any Email (on starting, renewing and finishing subscription) as well as I have no file changes on server (access_token.php) (last file change was happened when I tested for Android). Is it correct for sandbox?

    5_.In Sandbox for 1-month auto-renewable subscription after 30 min subscription is Automatically Canceled. Ok. Correct.

    But After that I have access to subscription for some minutes. (Yes, I tried to restart the app).

    Is it the safe period when the user needs to update their card info or fund moneys? (In App Store Connect I set "Billing Grace Period" to ON.)



  • In my last reply, I wrote that I was able to test and reproduce the DuplicateTransaction error only once, while a subscription was active.

    4- There is no access token for iOS. This is only used for Android.
    5- A one-month subscription is active for 5 minutes with 6 renewals = 35 minutes.

    The billing grace period is not related to this.



  • @Baroni

    @Baroni said in iOS: Subscription Issues:

    In my last reply, I wrote that I was able to test and reproduce the DuplicateTransaction error only once, while a subscription was active.

    3- I saw your message, but in my experience If I click "Subscribe" after Restoring without active subscription then I have this error. Why I get this & How to handle it?

    I noticed in logs that I will get more & more restored transactions while testing my subscription many cycles, so expired subscriptions are also restored.

    @Baroni said in iOS: Subscription Issues:

    4- There is no access token for iOS. This is only used for Android.

    and therefore I don't have emails and file changes? So in this case how can I test it before release? Or you mean that after release I will not see file changes for iOS, because it is only for Android?

    @Baroni said in iOS: Subscription Issues:

    5- A one-month subscription is active for 5 minutes with 6 renewals = 35 minutes.
    The billing grace period is not related to this.

    My math is based around the facts. In the official docs here I see 5 renewals, not 6 like on Android:

    "Duration times are shortened when testing your auto-renewable subscriptions in sandbox and will auto-renew five times before unsubscribing the subscriber."

    So:
    -- Subscribed (5 min)
    -- 5 auto-renew (5 min) = 25 min
    -- Automatically Canceled after 30 min, not 35.

    So because my question #5 is still actual. Why I have some delay(less than 5 min)?



  • We are drifting away from actual facts and get into theoretical areas. Please provide XCode logs showing the exact renewal times and validation attempts.

    3- I saw your message, but in my experience If I click "Subscribe" after Restoring without active subscription then I have this error. Why I get this & How to handle it?

    I am not able to resolve something I cannot reproduce reliably. It could be your sandbox account, Unity IAP or something else. I really don't know just by reading it.

    My XCode test logs, in historical order: app receipt with a 1-month subscription product with an originalPurchaseDate bought at 2:08:13. Renewed 5 times and expired at 2:38:16.

    2020-10-24 16:44:00.511271+0200 SimpleIAPSystem[529:15691] UnityIAP: Requesting product data...\
    2020-10-24 16:44:01.627355+0200 SimpleIAPSystem[529:15691] UnityIAP: Received 4 products\
                        productID: 7_Days\
                    transactionID: 1000000733865637\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:08:12 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:13:12 PM\
                        productID: 7_Days\
                    transactionID: 1000000733865929\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:13:12 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:18:12 PM\
                        productID: 7_Days\
                    transactionID: 1000000733867060\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:18:12 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:23:12 PM\
                        productID: 7_Days\
                    transactionID: 1000000733867527\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:23:12 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:28:12 PM\
                        productID: 7_Days\
                    transactionID: 1000000733867909\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:28:16 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:33:16 PM\
                        productID: 7_Days\
                    transactionID: 1000000733868945\
    originalTransactionIdentifier: 1000000733865637\
                     purchaseDate: 10/24/2020 2:33:16 PM\
             originalPurchaseDate: 10/24/2020 2:08:13 PM\
       subscriptionExpirationDate: 10/24/2020 2:38:16 PM\
    

    Restoration attempt at 2:44:39, nothing was restored.

    2020-10-24 16:44:39.112661+0200 SimpleIAPSystem[529:15691] UnityIAP: Restore transactions\
    2020-10-24 16:44:39.113076+0200 SimpleIAPSystem[529:15691] UnityIAP: RestorePurchase\
    2020-10-24 16:44:41.284190+0200 SimpleIAPSystem[529:15691] UnityIAP: UpdatedTransactions\
    2020-10-24 16:44:41.305934+0200 SimpleIAPSystem[529:15691] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished\
    2020-10-24 16:44:41.352820+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871080\
    2020-10-24 16:44:41.353450+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871081\
    2020-10-24 16:44:41.353850+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871082\
    2020-10-24 16:44:41.354225+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871083\
    2020-10-24 16:44:41.354580+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871084\
    2020-10-24 16:44:41.354923+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871085\
    IAPListener reports: HandleSuccessfulPurchase: restore\
    SIS.IAPListener:HandleSuccessfulPurchase(String)\
    UnityEngine.Purchasing.Extension.UnityUtil:Update()\
     \
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)\
    \
    

    Purchase attempt of the same product 10 seconds later. No DuplicateTransaction error.

    2020-10-24 16:44:51.914270+0200 SimpleIAPSystem[529:15691] UnityIAP: PurchaseProduct: 7_Days\
    2020-10-24 16:44:51.928654+0200 SimpleIAPSystem[529:15691] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles\
    2020-10-24 16:44:51.930618+0200 SimpleIAPSystem[529:15691] [MC] Reading from public effective user settings.\
    purchase(\{0\}): 7_Days\
    SIS.IAPItem:Purchase()\
    
    2020-10-24 16:45:19.857150+0200 SimpleIAPSystem[529:15691] UnityIAP: UpdatedTransactions\
    -> applicationDidBecomeActive()\
    UnityIAP: Promo interface is available for 3 items\
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)\
    UnityEngine.Purchasing.Extension.UnityUtil:Update()\
     \
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)\
    2020-10-24 16:45:24.763830+0200 SimpleIAPSystem[529:15691] UnityIAP: Finishing transaction 1000000733871184\
    7_Days verification success.\
    SIS.<WaitForRequest>d__5:MoveNext()\
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)\
     \
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)\
    \
    IAPListener reports: HandleSuccessfulPurchase: 7_Days\
    SIS.IAPListener:HandleSuccessfulPurchase(String)\
    SIS.IAPManager:PurchaseVerified(String)\
    SIS.<WaitForRequest>d__5:MoveNext()\
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)\
     \
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)\
    \
    

    and therefore I don't have emails and file changes? So in this case how can I test it before release? Or you mean that after release I will not see file changes for iOS, because it is only for Android?

    No emails, no file changes. That's what I wrote - the file is for Android only. You test it by debugging and looking at the receipts and transactions in XCode.

    My math is based around the facts. In the official docs here I see 5 renewals, not 6 like on Android

    True, it has been 6 renewals one year ago. They changed it to 5, which is also proven by the first log above.

    Why I have some delay(less than 5 min)?

    Please provide logs. But with the minimum subscription duration of one week, does up to 5 minutes delay really matter? It doesn't seem like something the receipt validation can do here.



  • @Baroni said in iOS: Subscription Issues:

    Please provide logs. But with the minimum subscription duration of one week, does up to 5 minutes delay really matter? It doesn't seem like something the receipt validation can do here.

    "does up to 5 minutes delay really matter?" — it Doesn't for Sandbox. But as software engineer I wanted to know the reason of it. If this is something like observational error — ok, but I need a proof to understand that app is working correctly and there is no mysterious free period of subscription.

    As I wrote above I use 1-month subscription only — the only IAP in the App — so 5 min in sandbox is 1 month in production. How long this delay will be in production — I don't know for now.

    I will back to you with more detailed testing.



  • Today are 1 purchase & 5 renewals (not 6), but as previously after subscription was expired I have 2-3 min delay when app detects expiration on restart. Within these 2-3 minutes I make restart several times.

    UnityIAP: Requesting product data...
    UnityIAP: Received 1 products
    
    		    productID: subscription
                    transactionID: 1000000731179322
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:07:48 AM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 11:12:48 AM
                        productID: subscription
                    transactionID: 1000000731179332
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:12:48 AM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 11:17:48 AM
                        productID: subscription
                    transactionID: 1000000731179326
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:17:48 AM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 11:22:48 AM
                        productID: subscription
                    transactionID: 1000000731180288
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:22:48 AM
             originalPurchaseDate: 10/17/2020 6:54:25 PM
       subscriptionExpirationDate: 10/17/2020 11:27:48 AM
                        productID: subscription
                    transactionID: 1000000731179327
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:27:48 AM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 11:32:48 AM
                        productID: subscription
                    transactionID: 1000000731179325
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 11:32:55 AM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 11:37:55 AM
                        productID: subscription
                    transactionID: 1000000731179331
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 4:53:31 PM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 4:58:31 PM
                        productID: subscription
                    transactionID: 1000000731179323
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 4:58:31 PM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 5:03:31 PM
                        productID: subscription
                    transactionID: 1000000731179330
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 5:03:31 PM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 5:08:31 PM
                        productID: subscription
                    transactionID: 1000000731180296
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 5:09:17 PM
             originalPurchaseDate: 10/17/2020 6:54:25 PM
       subscriptionExpirationDate: 10/17/2020 5:14:17 PM
                        productID: subscription
                    transactionID: 1000000731180290
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 5:14:17 PM
             originalPurchaseDate: 10/17/2020 6:54:25 PM
       subscriptionExpirationDate: 10/17/2020 5:19:17 PM
                        productID: subscription
                    transactionID: 1000000731179333
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/17/2020 5:19:17 PM
             originalPurchaseDate: 10/17/2020 6:46:35 PM
       subscriptionExpirationDate: 10/17/2020 5:24:17 PM
                        productID: subscription
                    transactionID: 1000000736001589
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:27:32 PM
             originalPurchaseDate: 10/29/2020 5:27:33 PM
       subscriptionExpirationDate: 10/29/2020 5:32:32 PM
                        productID: subscription
                    transactionID: 1000000736003796
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:32:32 PM
             originalPurchaseDate: 10/29/2020 5:31:45 PM
       subscriptionExpirationDate: 10/29/2020 5:37:32 PM
                        productID: subscription
                    transactionID: 1000000736005015
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:37:32 PM
             originalPurchaseDate: 10/29/2020 5:36:57 PM
       subscriptionExpirationDate: 10/29/2020 5:42:32 PM
                        productID: subscription
                    transactionID: 1000000736006049
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:42:32 PM
             originalPurchaseDate: 10/29/2020 5:41:53 PM
       subscriptionExpirationDate: 10/29/2020 5:47:32 PM
                        productID: subscription
                    transactionID: 1000000736007979
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:47:32 PM
             originalPurchaseDate: 10/29/2020 5:46:47 PM
       subscriptionExpirationDate: 10/29/2020 5:52:32 PM
                        productID: subscription
                    transactionID: 1000000736008942
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 10/29/2020 5:52:32 PM
             originalPurchaseDate: 10/29/2020 5:52:35 PM
       subscriptionExpirationDate: 10/29/2020 5:57:32 PM
    

    Restore in 30 min:

     2020-10-29 21:25:44.560792+0300 [13820:4820518] UnityIAP: Restore transactions
    2020-10-29 21:25:44.561018+0300 [13820:4820518] UnityIAP: RestorePurchase
    2020-10-29 21:25:46.232211+0300 [13820:4820518] UnityIAP: UpdatedTransactions
    2020-10-29 21:25:46.241073+0300 [13820:4820518] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished
    2020-10-29 21:25:46.249927+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016081
    2020-10-29 21:25:46.250155+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016082
    2020-10-29 21:25:46.250304+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016083
    2020-10-29 21:25:46.250430+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016084
    2020-10-29 21:25:46.250559+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016085
    2020-10-29 21:25:46.250674+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016086
    2020-10-29 21:25:46.250797+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016087
    2020-10-29 21:25:46.250903+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016088
    2020-10-29 21:25:46.251012+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016089
    2020-10-29 21:25:46.251120+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016090
    2020-10-29 21:25:46.251275+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016091
    2020-10-29 21:25:46.251574+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016092
    2020-10-29 21:25:46.251825+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016093
    2020-10-29 21:25:46.252068+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016094
    2020-10-29 21:25:46.252349+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016095
    2020-10-29 21:25:46.252583+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016096
    2020-10-29 21:25:46.252779+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016097
    2020-10-29 21:25:46.253056+0300 [13820:4820518] UnityIAP: Finishing transaction 1000000736016098
    IAPListener reports: HandleSuccessfulPurchase: restore
    SIS.IAPListener:HandleSuccessfulPurchase(String)
    System.Action`1:Invoke(T)
    System.Action`1:Invoke(T)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
    

    But if I restore within subscription period (just for testing), then I get verification process for each transaction, is it normal?

    2020-10-29 20:29:56.163662+0300 [13694:4791027] UnityIAP: Restore transactions
    2020-10-29 20:29:56.163974+0300 [13694:4791027] UnityIAP: RestorePurchase
    2020-10-29 20:29:57.795860+0300 [13694:4791027] UnityIAP: UpdatedTransactions
    2020-10-29 20:29:57.801144+0300 [13694:4791027] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    UnityIAP Promo: Clearing promo product metadata
    UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    IAPListener reports: HandleSuccessfulPurchase: restore
    SIS.IAPListener:HandleSuccessfulPurchase(String)
    System.Action`1:Invoke(T)
    System.Action`1:Invoke(T)
    System.Action:Invoke()
    UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    💵 Purchases were restored.
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.260522+0300 [13694:4791027] UnityIAP: Finishing transaction 1000000736002286
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.352701+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.453953+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.537525+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.691821+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:00.841485+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:01.555981+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:01.637394+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:02.594317+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:02.654267+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:02.713373+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:02.772836+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    ERROR: 
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    TEXT: ["subscription"]
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    2020-10-29 20:30:02.831761+0300 [13694:4791027] UnityIAP: Transaction 1000000736002286 not pending, nothing to finish here
    subscription verification success.
    SIS.<WaitForRequest>d__5:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    
    

    If I restore after purchasing within 1 minute or if I click subscribe after restoring within 1 min , then I have DuplicateError. I guess IAP System is some slow, because if I make these Sequencing after 1 minute then I have NO DuplicateError.



  • Thank you for the logs and additional details regarding the DuplicateError at the end, very helpful! I'm going to look into that soon and try to contact the Unity IAP team for further clarification - unfortunately this might take a while, their support is really slow during the last weeks, as you might have read on the publisher forums too.

    But if I restore within subscription period (just for testing), then I get verification process for each transaction, is it normal?

    Definitely not. The receipt on iOS contains all products and transaction in one combined receipt, so there is no need to send it multiple times. Will check on that too.



  • @Baroni

    @Baroni said in iOS: Subscription Issues:

    Thank you for the logs and additional details regarding the DuplicateError at the end, very helpful!

    I remembered additional info from July when we made conversation about subscription here:

    Assets/SimpleIAPSystem/Scripts/ReceiptValidatorServer.cs(158,13): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
    

    if it makes sense for slowness in whole for this error, I don't know, just remind you.



  • Addition:

    Today I tested Subscription Again. During testing with active subscription, I got distracted and returned to testing in 20 min after subscription was expired. I restart the app and got active subscription state. For 2nd restart I got expired subscription.

    Next I subscribed again & didn't get any renewals (hmm, 1st time such situation). And Next I got the same situation with 1st and 2nd restarts as above.

    As you suggested me earlier, my verification type was set to "Both" in Receipt Validator Server script.



  • Addition 2:
    Also, there is a situation when I have some delay until next renewal (50 sec as you can see) and within this 50 sec I have no active state of subscription:

    purchaseDate: 11/6/2020 1:48:31 PM
             originalPurchaseDate: 11/6/2020 1:48:32 PM
       subscriptionExpirationDate: 11/6/2020 1:53:31 PM
                        productID: subscription
                    transactionID: 1000000738890802
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 11/6/2020 1:53:31 PM
             originalPurchaseDate: 11/6/2020 1:52:32 PM
       subscriptionExpirationDate: 11/6/2020 1:58:31 PM
                        productID: subscription
                    transactionID: 1000000738895836
    originalTransactionIdentifier: 1000000731134874
                     purchaseDate: 11/6/2020 1:59:14 PM
             originalPurchaseDate: 11/6/2020 1:59:16 PM
       subscriptionExpirationDate: 11/6/2020 2:04:14 PM
    


  • The receipts are logged by Unity IAP. There's nothing I could do to improve the native transactions.

    I can only imagine that server or connection issues could result in a delay - maybe even caused by Apple.



  • I also noticed next behavior only on iOS (Android doesn't have such issue) with software versions I described above.

    Once per lifecycle (30 min) the state of "DBManager.isPurchased(subscription)" is set to "false" upon some restart of app. And this state persists some restarts (no more than a couple of minutes) — I can't detect behavior pattern of it. Further, at some point I get "true" and this state persists until the end of lifecycle.


Log in to reply