Why In-App purchase sandbox always ask “Verification Required”?

后端 未结 11 1124
离开以前
离开以前 2020-12-05 14:51

I have signed out from the store in device settings. I entered user credentials only in my App. I have set up a brand new (actually around 4 times) test user.

Why th

相关标签:
11条回答
  • 2020-12-05 15:27

    Register a fresh test user for the USA. You can put any email address.

    Log out under settings. Delete the app. start it again via xCode login with your new user within the app.

    It may say that you are not located in the USA and it opens the browser, Close the browser and start it again.

    It should work now.

    0 讨论(0)
  • 2020-12-05 15:29

    Even in sandbox, you need to complete the buy verifying the receipt to the server. It corresponds to steps 6-7-8 of built-in model and 11-12-13 of the server model.

    http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/APIOverview/OverviewoftheStoreKitAPI.html

    All you need to do is:

    Retrieve the receipt data from the transaction’s transactionReceipt property and encode it using base64 encoding.create a json like this:

    {
        "receipt-data" : "(receipt in base 64 encoding)"
    }
    

    Make a post to verification URL for production:

    https://buy.itunes.apple.com/verifyReceipt

    For sandbox :

    https://sandbox.itunes.apple.com/verifyReceipt

    The response is like this:

    {
        "status" : 0,
        "receipt" : { ... }
    }
    

    If the value of the status key is 0, this is a valid receipt. If the value is anything other than 0, this receipt is invalid.

    For further information look the guide: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html

    0 讨论(0)
  • 2020-12-05 15:29

    If you are having such problem for 4th IAP item to buy.

    It looks, each test account does not work for purchasing more than 3 items of an application. You may create a new test account from itunesconnect.apple.com->Manage Users->Test User to test your 4th IAP item.

    0 讨论(0)
  • 2020-12-05 15:30

    In addition of the above answers, note the below points also :-

    1) Uninstall your app from the device.

    2) Create a new test account on iTunes Connect and verify its email address. Never add any payment information for this test account, not online, not on iTunes, not on your device. Doing so might invalidate your test account (and trigger the "verify payment info" vicious cycle.) Also never use this test account out of the Sandbox.

    3) Log-out from the App Store on your device. DO NOT log back in the App Store via Settings > iTunes & App Stores on your device. You will be asked your login credentials from your app later (see points 5-6)

    4) Re-install your app.

    5) Attempt an in-app purchase. You should now be prompted to enter both your username and password (as you logged out from the App Store)

    6) Type in your username and password: you should not see the dreadful "Verification Required: before you can make purchases, you must verify your payment info" message and the purchase should be successful.

    0 讨论(0)
  • 2020-12-05 15:30

    Swift 3

    Insert this temporary code somewhere in your project:

    for transaction: AnyObject in SKPaymentQueue.default().transactions {
        guard let currentTransaction: SKPaymentTransaction = transaction as? SKPaymentTransaction else {return}
        SKPaymentQueue.default().finishTransaction(transaction as! SKPaymentTransaction)
    }
    

    This clears out the payment queue. Make sure to run it much later than viewDidLoad if you can. I made mine triggered by a button. Ran it a couple times, then removed the code. No more annoying verification pop-ups.

    0 讨论(0)
  • 2020-12-05 15:30

    I saw this issue after iOS5 got released.

    Earlier I used to create test accounts with dummy email addresses and it used to work well for me, but post iOS5, it started showing verification required for test accounts.

    Thus I ended up using actual email addresses for the test accounts and verified when asked for, which seemed to do the trick for me.

    0 讨论(0)
提交回复
热议问题