Search Unity

UnityIAP: Requesting product data... and nothing happend

Discussion in 'Unity IAP' started by DLight, Apr 5, 2020.

  1. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    Yesterday my testflight app show products. But afternoon when I tested again not showed them.
    I try with Xcode and after this request nothing happends:
    UnityIAP: Requesting product data...
    The code didnt change. Every products are approved.
    Agrements are accepted.
    What happend?
    Thank you
     
    Last edited: Apr 6, 2020
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share your full IAP related logs, and your code. Are you on WiFi, where are you located?
     
  3. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    The strange thing was these:
    Afternoon.
    APP is working. Next start not working in Xcode.
    Load early version in testFleght, it isn't work too.
    Apple page: Paid App agreement need approve. OK and fill the missing contacts. Products don't came.
    Evening it work perfect, products came.
    Next day afternoon products not came...and they haven't come since.
    This is my first iOS crossplatform project, so sorry if I mistake something.
    The start log:

    2020-04-06 11:43:43.770352+0200 player[331:9782] UnityIAP UnityEarlyTransactionObserver: Created
    2020-04-06 11:43:43.771004+0200 player[331:9782] UnityIAP UnityEarlyTransactionObserver: Registered for lifecycle events
    CrashReporter: initialized
    2020-04-06 11:43:43.996562+0200 player[331:9782] Built from '2019.2/staging' branch, Version '2019.2.4f1 (c63b2af89a85)', Build type 'Development', Scripting Backend 'il2cpp'
    2020-04-06 11:43:44.007831+0200 player[331:9782] -> registered mono modules 0x1024051e0
    -> applicationDidFinishLaunching()
    PlayerConnection initialized from /private/var/containers/Bundle/Application/E0B5E49C-02AF-4FF8-AB29-F945AC97AD63/player.app/Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55000
    Multi-casting "[IP] 192.168.0.31 [Port] 55000 [Flags] 2 [Guid] 780434484 [EditorId] 2617779612 [Version] 1048832 [Id] iPhonePlayer(Veres-Tibors-iPhone):56000 [Debug] 0 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
    Started listening to [0.0.0.0:55000]
    PlayerConnection already initialized - listening to [0.0.0.0:55000]
    2020-04-06 11:43:44.112472+0200 player[331:9782] Metal GPU Frame Capture Enabled
    2020-04-06 11:43:44.305413+0200 player[331:9782] UnityIAP UnityEarlyTransactionObserver: Added to the payment queue
    2020-04-06 11:43:44.351967+0200 player[331:9782] FBSDKLog: fb-messenger-share-api is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0
    -> applicationDidBecomeActive()
    [XR] Discovering subsystems at path /private/var/containers/Bundle/Application/E0B5E49C-02AF-4FF8-AB29-F945AC97AD63/player.app/Data/UnitySubsystems
    GfxDevice: creating device client; threaded=1
    Initializing Metal device caps: Apple A10 GPU
    Initialize engine version: 2019.2.4f1 (c63b2af89a85)
    CrashReporter: No pending report exists at /var/mobile/Containers/Data/Application/41BBC716-B2A1-4C16-A054-DA1F12FC35AD/Library/Caches/CrashReports/crash-pending.plcrash
    2020-04-06 11:43:45.305966+0200 player[331:9782] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x1083a9040>.
    2020-04-06 11:43:45.347565+0200 player[331:10031] [] tcp_input [C3.1:3] flags=[R] seq=3798028765, ack=0, win=0 state=CLOSED rcv_nxt=3798028765, snd_una=23579002
    2020-04-06 11:43:45.359683+0200 player[331:10031] [] tcp_input [C4.1:3] flags=[R] seq=1042332195, ack=0, win=0 state=CLOSED rcv_nxt=1042332195, snd_una=1305613406
    2020-04-06 11:43:45.365285+0200 player[331:10032] [] tcp_input [C3.1:3] flags=[R] seq=3798028765, ack=0, win=0 state=CLOSED rcv_nxt=3798028765, snd_una=23579002
    2020-04-06 11:43:45.367354+0200 player[331:10032] [] tcp_input [C4.1:3] flags=[R] seq=1042332195, ack=0, win=0 state=CLOSED rcv_nxt=1042332195, snd_una=1305613406
    UnloadTime: 1.889042 ms
    UnityIAP Version: 1.22.0
    UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)
    IAPManager:InitializePurchasing()
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    Using Facebook Unity SDK v7.16.1 with FBiOSSDK/5.15.1
    Facebook.Unity.CompiledFacebookLoader:Start()
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    Using configuration builder objects
    UnityEngine.Purchasing.StoreCatalogImpl:handleCachedCatalog(Action`1)
    System.Action`1:Invoke(T)
    UnityEngine.Purchasing.<Process>d__4:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-04-06 11:43:47.561257+0200 player[331:9782] UnityIAP: Requesting 2 products
    2020-04-06 11:43:47.562346+0200 player[331:9782] UnityIAP: Requesting product data...

    and the follow log not include any content of IAP
    Thnak U your help
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I believe you forgot to provide the requested code. Also, I might recommend to use IAP 1.23.1 instead of 1.22, but it's not directly relevant to your issue. You need to find out what's changed. As long as you don't see any exceptions further down in your log. You might want to compare your project to this Sample IAP project https://forum.unity.com/threads/sample-iap-project.529555/
     
  5. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    Thank you, I take a try.
     
  6. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    I made a new build just for testing IAP.
    Put the 2 product. Build and run in Xcode. The problem is the same. Stuck at product request.

    2020-04-07 12:40:47.714659+0200 player[1072:45918] UnityIAP UnityEarlyTransactionObserver: Created
    2020-04-07 12:40:47.714992+0200 player[1072:45918] UnityIAP UnityEarlyTransactionObserver: Registered for lifecycle events
    CrashReporter: initialized
    2020-04-07 12:40:47.755878+0200 player[1072:45918] Built from '2019.2/staging' branch, Version '2019.2.4f1 (c63b2af89a85)', Build type 'Development', Scripting Backend 'il2cpp'
    2020-04-07 12:40:47.760865+0200 player[1072:45918] -> registered mono modules 0x1047a2bd0
    -> applicationDidFinishLaunching()
    PlayerConnection initialized from /private/var/containers/Bundle/Application/7D4AE8DA-A0A0-4A41-A438-FB93ECDCA6EA/player.app/Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55000
    Multi-casting "[IP] 192.168.0.31 [Port] 55000 [Flags] 2 [Guid] 3304680355 [EditorId] 220033092 [Version] 1048832 [Id] iPhonePlayer(Veres-Tibors-iPhone):56000 [Debug] 0 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
    Started listening to [0.0.0.0:55000]
    PlayerConnection already initialized - listening to [0.0.0.0:55000]
    2020-04-07 12:40:47.813786+0200 player[1072:45918] Metal GPU Frame Capture Enabled
    2020-04-07 12:40:47.910144+0200 player[1072:45918] UnityIAP UnityEarlyTransactionObserver: Added to the payment queue
    -> applicationDidBecomeActive()
    [XR] Discovering subsystems at path /private/var/containers/Bundle/Application/7D4AE8DA-A0A0-4A41-A438-FB93ECDCA6EA/player.app/Data/UnitySubsystems
    GfxDevice: creating device client; threaded=1
    Initializing Metal device caps: Apple A10 GPU
    Initialize engine version: 2019.2.4f1 (c63b2af89a85)
    CrashReporter: No pending report exists at /var/mobile/Containers/Data/Application/DE3BC714-BA77-45F7-8333-937292294F64/Library/Caches/CrashReports/crash-pending.plcrash
    2020-04-07 12:40:48.280548+0200 player[1072:45918] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x10943b380>.
    UnloadTime: 1.712958 ms
    UnityIAP Version: 1.23.1
    UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)
    MyIAPManager:InitializePurchasing()
    MyIAPManager:Start()
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    Complete = True
    MyIAPManager:MyDebug(String)
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    Using configuration builder objects
    UnityEngine.Purchasing.StoreCatalogImpl:handleCachedCatalog(Action`1)
    System.Action`1:Invoke(T)
    UnityEngine.Purchasing.<Process>d__4:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-04-07 12:40:50.679369+0200 player[1072:45918] UnityIAP: Requesting 2 products
    2020-04-07 12:40:50.680066+0200 player[1072:45918] UnityIAP: Requesting product data...

    I think it is an apple ... thing.. because in testflight worked. than didn't, and I haven't change it. It is the same version.
    I write to apple.
    Thank you your help.
     
    JeffDUnity3D likes this.
  7. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    Sorry but what is the request code? Does it change somewhere out of the application?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, I meant, I wanted to look at the source code that you are using.
     
  9. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    The main problem is, I use the example code with my products, and stuck when received the product datas. I think it sin't source problem. I'm writeing to apple, so waiting the respons.
    Thank you your help, I will write.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I don't think it's Apple, no one else is reporting the problem. It's possible but not likely. Please provide the code that you are using as an attachment. I want to see how you defined your products both in your code, and on Apple. Please provide a screenshot of your products on the Apple dashboard.
     
  11. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    I attached the source of iap and a screenshoot from products.
    My problem is, didn't change the source. It worked, than not..and work again, and not again after half day.
    And I try the basic with my products, test in xcode by device, it didn't work.
     

    Attached Files:

  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, I just wanted to confirm! Yes, the product definitions look correct. Please keep us posted. Are you able to test with a different iOS device by chance? Is this on TestFlight? If so, send me a private message here, and I'll give you my TestFlight email, and I'll give it a try also.
     
  13. DLight

    DLight

    Joined:
    Oct 7, 2012
    Posts:
    15
    I downloaded the newest IAP, meanwhile sent some email to apple. And it is working....
    I don't know what happend, maybe apple forget set something..but it works.
    Thanks the help and your time.
     
    JayR likes this.
  14. Deleted User

    Deleted User

    Guest

    Was there any follow-up on this? I'm seeing the same issue at the moment.


    2021-03-18 17:07:41.104494+0100 etg[9013:3843249] UnityIAP: Requesting 1 products
    2021-03-18 17:07:41.105181+0100 etg[9013:3843249] UnityIAP: Requesting product data...
    2021-03-18 17:08:16.104603+0100 etg[9013:3843249] [BackgroundTask] Background Task 2 ("SKProductsRequest"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.


    Everything was working fine yesterday evening. Running the same build today and the product data request does not finish.

    This is all in sandbox testing. Could it be that Apple's sandbox environment is not responding for some reason?

    Regardless, it would be nice if UnityIAP didn't just hang.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What call is hanging, can you reproduce and debug? Are you you using 3.0.1?
     
  16. Deleted User

    Deleted User

    Guest

    Yes, we're on 3.0.1. I'm currently debugging it in Xcode and it seems like the request delegate for SKProductsRequest is never called, not even with a failure.
     
  17. Deleted User

    Deleted User

    Guest

    So basically we're calling
    Code (CSharp):
    1. UnityPurchasing.Initialize(this, builder);
    from our store listener and never receive a response in OnInitialized/OnInitializeFailed since the native code that fetches the product data never finishes.

    This seemed relevant: https://stackoverflow.com/questions/9935054/storekit-delegate-method-not-getting-called

    basically their problem seemed to be that the request object gets garbage collected before completion. I tried making changes in UnityPurchasing.m to reflect the solution suggested there, but to no avail.
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you seeing the same behavior as others, sometimes works, sometimes doesn't? I'm not able to reproduce.
     
  19. Deleted User

    Deleted User

    Guest

    Right now it does not work at all, consistently.

    Edit: but it did work yesterday.
     
  20. Deleted User

    Deleted User

    Guest

    Just tried initialising without any products, then it works. Tried initialising with a single product with a bogus store ID, no response.
     
  21. Deleted User

    Deleted User

    Guest

    After waiting a while in the case where I initialised with a bogus store ID I actually got a timeout:

    2021-03-18 18:35:28.791309+0100 etg[9633:3883906] UnityIAP: SKProductRequest::didFailWithError: -1001, Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSLocalizedDescription=The request timed out., NSUnderlyingError=0x282b4ebe0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1001.)" UserInfo={NSLocalizedDescription=The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1001.)}}}.


    This is the first time I'm seeing a timeout, and I've left it hanging for long periods of time today.
     
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Do you mean productID instead of store ID? I will test also.
     
  23. Deleted User

    Deleted User

    Guest

    Yeah, that's what I meant.
     
  24. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    And it works correctly with a valid productID?
     
  25. Deleted User

    Deleted User

    Guest

    Nope, it doesn't work at all with a valid productId.
     
  26. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So it's not related to productID, I misunderstood. So no need for me to test that.
     
  27. Deleted User

    Deleted User

    Guest

    Okay, I found a solution: restart the device. It was suggested by someone on StackOverflow and it actually solved it.
     
  28. Deleted User

    Deleted User

    Guest

    Seems to me that this is a bug in iOS / StoreKit. I couldn't see anything wrong in UnityIAP's implementation. Thank you for looking into this so fast!
     
  29. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It looks like a Sandbox issue to me. After about a minute, I finally got an OnPurchaseFailed/Unknown error in my test just now for an existing consumable that has always worked before. Tried a second time, and it worked.
     
    Deleted User likes this.