So I'm testing out an in-app purchase in my app. I've got the code set up properly and everything, but when I do attempt to buy or restore in the sandbox environment, I get this error:
MZCommerceInAppBuy.App BuyInfoDataAccessFailure_message
[Environment: Sandbox]
I've never seen this before, and I am finding only one Google search result from someone else who has. It never was solved. Has anybody seen this?
I figured out a solution. The problem was coming because I was adding an in-app purchase to the current live version of my app. I created a new version of my app and changed it on my target to the update version.
I also downloaded a new development provisioning profile. I'm not sure if this is necessary, but I wanted to add that I created a new one just in case.
When you add in-app purchases to an app, you must create a new app version even for testing.
Note:
Just a side note. I noticed while I received this error I also wan't receiving any in-app purchase products. You will not receive any products until you create the new version.
Related
I have an odd problem on my hands with in-app purchases and any insight or help would be appreciated. I have in-app purchases setup for my app and have been using them regularly during testing; however, every once in a while the SKProductRequest will return with 0 products and won't load any products until I completely remove the app from the device and re-install it. Then everything shows up again and purchases can be made.
I'm not sure what is causing this problem. It may have something to do with the test environment for in-app purchases? I know everything is configured correctly seeing as I can normally use the in-app purchases without any errors. Thanks for any help.
There may be several causes to Product Requests failing on a device. Basically, the StoreKit environment is very picky: if something in the app seems weird (like the code signature, or the embedded Provisioning Profile, or multiple app with the same profiles), it will not sent the request, or receive invalid data.
A common cause of silent failures is having multiple Provisioning Profiles installed for the same app. You can try to:
Uninstall all Provisioning Profiles from your device (in Settings),
Remove the app from the Device (to remove the embedded Provisioning Profile),
Re-install the app.
I wrote a small blog post about this issue a few months ago, you may find more detailed informations there : http://kemenaran.winosx.com/?2011/12/02/180-ios-developer-what-to-do-if-in-app-purchases-stop-working
today I just opened my 1,5 month old project and wanted to add a new In-App-Purchase to the app, so I added all the information to iTunesConnect, didn't change anything for the existing ones. When I now run the app ALL of the purchases won't work, I'm using MKStoreKit but the SKRequest also doesn't throw any errors. In addition I'm getting the following logged in console without adding iCloud support:
NSUbiquitousKeyValueStore error: com.mycompany.myapp has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
Any suggestions what is going on and/or what I could have broken?
I'm getting the same error.
According to this nice blog: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/, step 7 to be specific, it might take time for Apple to put your new IAP in their sandbox server. So just take a break and come back after a few hours, :)
I found this information on a blog which talks about invalid product ids.
http://troybrant.net/blog/2010/01/invalid-product-ids/
I tried everything suggested in the
Apple forums and here, and still
couldn’t get it to work. Found the
solution – your app needs to be
transferred by Xcode for the sandbox
to be enabled.
Obvious, right? Well, if you are
working with an update to an existing
account, the device will still treat
it as an App Store-installed app.
Delete it, then transfer it again. It should work now :)
i am also getting invalid product ids.i am not able to get clear in the above said point...
i am not able to understand what i need to do when transferring the application into device...
Kindly guide me out and thanks for your help
That point just means that you need to run the app from Xcode in order for the sandbox to be available. (Build and Run)
Invalid product ids are a major pain to debug. If you're sure you've gotten everything on that checklist, then you just need to wait. Then only other problem that I've seen is that you might need to remove the app from the device and redeploy in order to get good products back from the store.
I had trouble getting the app store to recognize my sandbox test account. I had to log out wit iTunes, sync, then log in again with iTunes. Just using the device itself to log in/out didn't help.
I have implemented In App purchase in one of the existing application. I have also created SandBox account for testing it. I have run the application and tested it, its working perfect. Since, I have tested it, by buying the feature, it means I have bought that feature.
Now, there is a change in code and I want to re-test it (In App purchase thing), but since the feature is already bought I cannot test it again.
I am running and testing the application from Xcode, so I tried to delete the application from device and run / test it again by from Xcode, still no result.
If you just want to test re-downloading the content, deleting the application works.
If you want to actually re-buy it, how about creating a new additional sandbox account?
My in app purchase project working perfectly now, but I need to test purchasing and when once purchase is successfully done it cannot be undone? How can I test in app purchasing and upgrading my app to full version when it can be done just one time?
Delete the app from your device
Run "Clean" from the Product menu in XCode
On your device, go to "Settings", "Store", "Apple ID", and Sign Out
Start your app again, since you're not signed in to any account, the previous in-app purchase will not be recognized and you'll be able to buy it/download it again with the same test user account
None of the answers is really correct. Even if the you remove the cached purchase from your testing device, the product is marked as bought in Apple's server, associated to your test Apple ID. So the testing will not exactly reproduce the expected behavior. This is very important for testing the restore products function use cases, for example.
As far as I know, the real answer to this question is: You can't without creating a new test account, but that's not a really big deal, you can even use an invented email address (no need to validate it), and you can delete the account after using it.
If you delete your app and reinstall it, you can repurchase products. It follows the same code flow and nearly exactly the same user experience (there is a dialog letting you know that you can repurchase for free the second time). Also you can create more test users in iTunes Connect to be sure that you are doing completely clean testing.
I've spent several weeks deleting and reinstalling my app many times per day to ensure that my storekit implementation works just like I want it too.
All you have to do is delete your app from the device. This will wipe out any NSUserDefaults where you may have stored in-app purchase details.
Once you run your app again, make the purchase one more time, and Store Kit will tell you this:
"You've already purchased this. Tap OK to download it again for free"
Once you tap OK, you go through the same sequence of events you did when you made your first in-app purchase, so you can test again and again.
Use unit tests on your app, with false data, until you're satisfied.
(create test code - for each module you use)
I think I'll need more description of your process to have a better answer.