Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

[iOS] ProcessPurchase is never called (iOS 10)

Discussion in 'Unity IAP' started by robertocasanovicolto, Nov 5, 2018.

  1. robertocasanovicolto

    robertocasanovicolto

    Joined:
    Jun 23, 2017
    Posts:
    13
    I have renewable IAPs in my app. Today i updated unity IAP to the latest version. After the update, everything is still working fine on iOS 11 but it's not on iOS 10. What basically happened is that i see the apple popups as usual, saying that the purchase is completed but the function defined as

    Code (CSharp):
    1. public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    is never called and the user gets stuck there.
    On iOS 11 the functions is called correctly.

    Unity IAP version: 1.20.1
    Unity version: 2017.4.2f2

    Last thing logged by Xcode:


    UnityIAP: Finishing transaction 1000000468519757
    -> applicationWillResignActive()
    2018-11-17 22:54:14.975901 global[7759:5638187] got willResignActive = (null)
    -> applicationDidBecomeActive()
    2018-11-17 22:54:15.696332 global[7759:5638187] got didBecomeActive(out) = (null)


    I tried to revert the updated files one by one and seems that the file preventing my code to work is Stores.dll

    Does someone know what's happening?
    Thank you : )
     
    Last edited: Nov 6, 2018
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,452
    Does this occur on TestFlight also? And when you mention "gets stuck there", can you elaborate? Does the application actually freeze?
     
  3. robertocasanovicolto

    robertocasanovicolto

    Joined:
    Jun 23, 2017
    Posts:
    13
    I'm trying this in sandbox environment (i didn't try TF sandbox but it usually behaves the same).

    Gets stuck there: i have a loading screen which is waiting for ProcessPurchase to be called to go on but that's never the case.

    Previous version (which was working on iOS 10 as well) was 1.18
     
  4. robertocasanovicolto

    robertocasanovicolto

    Joined:
    Jun 23, 2017
    Posts:
    13
    This might help. It's the last thing logged by Xcode:


    UnityIAP: Finishing transaction 1000000468519757
    -> applicationWillResignActive()
    2018-11-17 22:54:14.975901 global[7759:5638187] got willResignActive = (null)
    -> applicationDidBecomeActive()
    2018-11-17 22:54:15.696332 global[7759:5638187] got didBecomeActive(out) = (null)


    EDIT: i tried to revert the updated files one by one and seems that the file preventing my code to work is Stores.dll

    I'm adding these informations to the first post
     
    Last edited: Nov 6, 2018
  5. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    Have you tried it with a new Sandbox tester account?
    The Objective-C source code of Unity IAP is 'Assets\Plugins\UnityPurchasing\iOS\UnityPurchasing.m'. You can debug it in Xcode.
    The 'updatedTransactions' method should be called after you buy a product. And it will call 'onTransactionSucceeded' method then.
    You can print out the receipt.
    Please let me know if the 'onTransactionSucceeded' method is fired on iOS 10.
     
  6. robertocasanovicolto

    robertocasanovicolto

    Joined:
    Jun 23, 2017
    Posts:
    13
    Weird update: i was debugging as you asked and i noticed it was working fine all of a sudden. Then i tried to reproduce the issue reverting everything and reimporting the latest version again but still no problems.
    Maybe there was a temporary problem with apple Sandbox? I will do further investigations before doing a release with the new version but for now, thank you for your help!

    EDIT
    GOT IT: another developer changed the date on that device and forgot to put it back to "automatic" til this morning. I tried to put the date in the future again and i saw the issue. Not sure if this is intended
     
    Last edited: Nov 8, 2018
  7. 1257961942

    1257961942

    Joined:
    Jul 22, 2017
    Posts:
    5
    Can i suppose that it is not real problem ,but enviroment of sandbox ?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,452
    @1257961942 No, it was stated that it was the date on the device causing the issue
     
  9. 1257961942

    1257961942

    Joined:
    Jul 22, 2017
    Posts:
    5
    Oh,indeed.I had changed my test device date to test some game logic. Thank you!