Search Unity

[iOS] Used real user on development build to test purchasing - now get sign-in required every time

Discussion in 'Unity IAP' started by Tiberius1701, May 23, 2018.

  1. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    71
    While testing my app, I was logged in as my actual user and made a purchase on a development build. it completed, but now I get the accursed Sign-In Required screen every time my app starts. Is there anything I can do to clear it? I use codeless iAP currently.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Repeated sign-in is a behavior of the Apple Sandbox environment, you shouldn't see this live. To avoid the sign in, you could use a different user account.
     
  3. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    71
    Hi Jeff -

    Thank you for the quick response. Yes, this only exists on my iPad when I look at new builds from xcode, not when I download from the story - it's only a problem for me as the developer.

    I also use this iPad for day to day activities, so it is really an annoyance when testing the game. Is there any way to clear this without changing from my actual real user on the iPad?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you Google for "apple iap sandbox password prompts" you'll see several articles that discuss the issue on the Apple forums.
     
  5. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    71
    Yes, I definitely did that before posting here. Is there a way to call Apple-specific code from within Unity? I couldn’t figure out how to do the restore or reset with my c# code since I use codeless iAP.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  7. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    71
    I tried integrating a Restore button and pressing it both as a Sandbox user and as my real user, but as you predicted, it didn't remove the password prompts.

    From what I can find online, Apple suggests calling a "FinishTransaction", and I find this in the Unity documentation:

    https://docs.unity3d.com/ScriptReference/Purchasing.Extension.IStore.FinishTransaction.html

    but am at a loss how to structure the code to call it (I'm guessing I'll need to step through all of the previous transactions (there should only be one), then make sure it is finished, something along the lines that I found in a post:

    Code (CSharp):
    1. for transaction in SKPaymentQueue.defaultQueue().transactions {
    2.     SKPaymentQueue.defaultQueue().finishTransaction(transaction)
    3. }
    If there is any help you can provide, it would be greatly appreciated.
     
    Last edited: May 24, 2018
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    As I mentioned, I don't believe there is anything you can do. Apple Support would need to manually remove the transactions. Their recommendation is to either wipe the phone or use a different user account.