Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Initialization passes but IAP not working on OSX

Discussion in 'Unity IAP' started by Suguma, Jan 11, 2017.

  1. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    Hi

    Unity IAP was working for me on OSX sandbox, but it suddenly doesn't anymore.
    The initialization passes with no problems and I receive my products, but actually making a purchase or requesting the app's receipt fails completely.

    For purchasing, I'm prompted correctly for my account, confirmation of purchase in sandbox, etc, and after all prompts are shown, I get an unkown error and a PurchaseFailed: 0. I also get a "Sandbox: storeaccountd deny file-write-create" for Library/Caches/<myappbundle>, not sure if it's connected.
    Refreshing receipt simply fails with status 0 and I also get a "Sandbox: storeassetd deny file-read-data /dev".

    I'm having this problem on builds from both Unity 5.4.2 and 5.5.0. My IAP is updated and works on iOS.
    I have tested this a few months ago and it worked just fine, but now I'm completely clueless.

    Can someone help me, please?
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Suguma,

    Have you tried creating a new sandbox tester account with a new email address. On the Sandbox Tester documentation, that is the first suggestion if your sandbox account stops working:

    https://developer.apple.com/library....html#//apple_ref/doc/uid/TP40011225-CH25-SW9
     
  3. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    @ap-unity,

    I created a new Sandbox user and even deleted the old one, but the problem is still the same :c
     
  4. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    I managed to get the purchasing to work. I was actually trying to purchase a product with missing metadata.

    The refresh still doesn't work, though. It doesn't even prompt me for my account :/
     
  5. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    Hey, still facing this problem here! I'm currently on 5.5.1f1 with my Unity IAP up to date

    Again, what happens is:
    When I run an OSX build on sandbox, Unity IAP initializes correctly, receiving my products. I can then purchase any product as usual.
    When I try to refresh the app's receipt, I get an error and the console shows "UnityIAP: RefreshReceipt status 0". If I install the .pkg in another computer and run the app on sandbox there, I get a pop-up message saying the app is "Damaged and cannot be opened" (it is already open, though).

    I'm pasting my code here:

    Code (CSharp):
    1. private void RefreshReceipt()
    2. {
    3.     extensionProvider.GetExtension<IAppleExtensions>().RefreshAppReceipt(RefreshReceiptSuccess, RefreshReceiptError);
    4. }
    5.  
    6. private void RefreshReceiptSuccess(string receipt)
    7. {
    8.     // Do something with the receipt
    9. }
    10.  
    11. private void RefreshReceiptError()
    12. {
    13.     // Call the app's internal error method
    14. }
    I am positive that everytime I call RefreshReceipt I end up at the error method.

    Can someone please help? @ap-unity ?
     
  6. nathanf-unity

    nathanf-unity

    Unity Technologies

    Joined:
    Sep 30, 2016
    Posts:
    4
    Hi Suguma,

    Thank you for bringing this to our attention.

    I can confirm that I see the same behavior with a test app. It looks like this is not an issue with Unity IAP, which just wraps the call to Apple's StoreKit. To confirm this I created a simple Mac app outside of Unity and Unity IAP and confirmed that it returns the same error when testing on the sandbox store. I can't tell from Apple's documentation whether this behavior is a bug or expected on the sandbox store, but I went ahead and filed a bug report in Apple's bug tracking system about it.

    Depending on your use case, you may not need to call RefreshAppReceipt. If you are trying to restore purchases, you can call RestoreTransactions instead.

    If Apple responds to my bug report with any useful information I will be sure to pass it along. Thanks.
     
    Suguma and ap-unity like this.
  7. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    Oh, wow, didn't see that one coming :/

    Thanks a lot, @nathanf-unity! I will be waiting for Apple's response :)
     
  8. Suguma

    Suguma

    Joined:
    May 29, 2015
    Posts:
    26
    Hi, @nathanf-unity!

    Any news on this? I still get the same error :/
     
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Suguma

    We haven't heard anything from Apple about this issue. We will update you when we get a response.