How to transfer application into device when testing inapp purchases - iphone

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.

Related

MZCommerceInAppBuy.App BuyInfoDataAccessFailure_message

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.

NSUbiquitousKeyValueStore and In-App-Purchase

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, :)

In app purchases with MKStoreKit failing: "Problem in iTunes connect configuration for product: xxx"

I'm trying to implement in app purchases in my App using MKStoreKit. I've followed all the steps and I'm getting the error:
Problem in iTunes connect configuration for product:
I've recreated the provisioning profiles, checked the product id is the same as in itunes connect, sent and rejected a binary, trying to delete everything and set it up again and nothing is working.
Any idea?
I know this is a late reply, but somehow I could not find the answer to this problem elsewhere so I decided to post my experience in hopes it might help other frustrated people with this issue.
I have recently added an In-App purchase to my Free app and I faced the same problem during the testing phase and also once it was launched on App Store.
The answer is Patience. For some odd reason, after doing everything correctly, you need to wait for around a day before your product is recognized. So once you finish your Manage In-App product ID, you will only see it working the following day - so don't delete and recreate it again - just wait.
Furthermore, after submitting your app for approval with the first In-App product, even when your app is approved and available in the App Store, the In-App might not work at first and you will feel you did something wrong. Wait another day or so, and magically, it will start to work.
It didn't work in my case cause the phone was jailbroken. After restoring it worked like a charm.
my ipad was jailbroken. it was given this "Problem in iTunes connect configuration for product: xxx" i changed my ipad with regular(no jailbrek) ipad and it's working now.

How to test In App purchase again and again and again...?

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.

iPhone StoreKit - invalid product id's

I'm trying to test In App Purchase within the sandbox environment.
In order to test the code I did the following:
Created an In App Purchase Test User account under 'Manage Users' in iTunes Connect
Created some in app purchase products under 'Manage Your In App Purchases'. I used numeric values and alpha-numeric values for the Product IDs.
Loaded the app onto the iPhone, went to Settings->Store and logged out of the regular store and into the test account created in step 1
Set a breakpoint in the
(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
callback
All the submitted Product ID's are in the response.invalidProductIdentifiers property.
When submitting the request I first tried the exact Product IDs created during step 2. I also tried prefixing them with the Bundle ID:
NSString *id2 = #"com.super.duper.8";
NSSet *productList = [NSSet setWithObjects:id2, #"8", nil];
SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:productList];
Am I missing something obvious?
Any help is appreciated.
Achim
If you are still getting invalid product ids, I've been accumulating a checklist of all of the various causes:
http://troybrant.net/blog/2010/01/invalid-product-ids/
I spent two days struggling with all my productsRequest (for AppID) ended up in response.invalidProductIdentifiers list, instead of in response.products list. Apple definitely did an F grade job in dealing with their storekit. It is confusing, intertwined and complex.
I did finally resolved it. One very important lesson I learned as indicated by few in the forums: It may take many hours for what you entered on the itunesconnect.apple.com to take affect.
There are two parts: application name and AppID in your xcode and what you entered in itunesconnection, they have to match exactly (case sensitive). If you registered or modified your in-App AppleID (I also completed all my contracts and bank information as suggested by some that the purchase actions won't work without getting this part done), you may as well go to bed before testing it again because it really takes hours in my case to take affect. I was so frustrated battling with this issue before my 9 year old dragged me for bed time story then surprised to find the issue disappeared when I woke up.
I found the suggestions by Eddy71 in http://www.iphonedevsdk.com/forum/iphone-sdk-development/21035-problems-creating-test-user-app-purchase.html really helpful. Before resolving it I did everything I possibly could do in Eddy's check list and still got zero products, one of my fears was that whether without uploading the binary code to complete the application registration in itunesconnect was ok (no need to go live as taught in http://blog.mugunthkumar.com/coding/iphone-tutorial-%E2%80%93-in-app-purchases/). It is indeed ok. Make sure the "cleared for sale" is check and in the icon is green (you need an extra step to approve it after filling out the form). The other fear was that whether I can use developer provisional (not distribution provisional) in debug mode, it is also indeed ok. I hope this may help some of you. Good luck and have faith. It will work eventually.
Our issue was the last bullet point from Apple's FAQ, "Why are my product identifiers being returned in the invalidProductIdentifiers array?":
You did not complete all the financial requirements (see the "Contracts, Tax, and Banking Information" section of this document).
You did not use an explicit App ID.
You did not use the Provisioning Profile associated with your explicit App ID.
You did not use the correct product identifier in your code. See Technical Q&A, QA1329, 'In App Purchase Product Identifiers' for more information about product identifiers.
You did not clear your In App Purchase products for sale in iTunes Connect.
You might have modified your products, but these changes are not yet available to all the App Store servers.
If you or App Review rejected your most recent binary in iTunes Connect.
I changed the most recent version (which had been rejected) to "Waiting for Upload" by clicking "Ready to Upload Binary" in iTunes Connect and the problem was resolved after about 10 minutes.
it's OK that the phone is jailbroken, you just have to uninstall appSync in Cydia, then it works
Apple has a fantastic document which is not well known that covers this at the end. It also dispels some myths about things that don't help (eg. submitting a binary).
Technote 2259 "Adding In-App Purchase to your iOS and Mac Applications"
We ended up creating a new provisioning profile, there was a line somewhere (can't recall where, not in the docs for in app purchase) that stated that you have to enable in app purchase in the provisioning profile. We couldn't do that with our existing profile, so we created a new one and then we could enable it.
Try resetting the iphone settings and delete the app from iphone and use the request product id directly without the Bundle ID
For anyone else that has these issues, I highly recommend reading this thread on the Apple Forum.
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 application, the device will still treat it as an App Store-installed app.
So delete the app from your device. Then install the app back onto the device using Build & Run with your device tethered to your Mac. It should work now :)
In my case, I didn't complete the bank info, tax info, and contact info.Once I finish this, I can get my productID, hope this will help someone.
This is where you are going wrong, you need this in your code:
NSSet *productList = [NSSet setWithObjects:product id]
You can get this product id from iTunes connect.
And you need to make sure that you have created a test user, and have signed out of your original iTunes account. Please see do not sign in with test user account, regardless of what apple documentation says, just use it when a pop up appears.
What's that #"8" for? your product is named as com.super.duper.8 right?
http://blog.mugunthkumar.com/coding/iphone-tutorial-%e2%80%93-in-app-purchases/
Another issue I had was that I had to go to Window > Organizer in Xcode and delete my app and the provisioning profile(s) and re-add my development provisioning profile. I restarted the device and xcode as an extra measure.
I have tried every solution that available on the internet, and nothing worked, absolutely nothing. My problem: My device was jailbroken and had Cydia on it. I restored the device to factory defaults (Not jailbroken) and it worked the first time and returned the product ID no problem.
For me the problem was that I had chosen "Turn on Content Hosting" when set up the In-App purchase. So I had to turn it off and the problem was resolved.
It takes the store some time to make the products available to all server (see documentation). So you might experience a delay between creating a product in iTunes Connect and seeing that product id as a valid one when testing on device. For me it took around 12 hours till my products showed up.
A note for others: do not use an NSMutableSet for the product IDs. It has to be an NSSet!
If you want to keep your app data but you want to try deleting your app to fix this issue, sync your device first. Then delete your app and reinstall from Xcode -- this fixed the issue for me. Once it's working, you can restore your device from its backup -- this only takes a few minutes and the product requests still work after the restore.
Not exactly sure why, but when I changed the request's product ID from 'com.mycompany.myapp.product' to 'product' it started working. Maybe it's because of how I have the product configured in iTunes Connect.
Give it a try, might work for some of you...
replace:
NSSet *productList = [NSSet setWithObjects:id2, #"8", nil];
with:
NSSet *productList = [NSSet setWithObjects:#"8", nil];
Another problem that might be. If the name of your xCode project is not written of English, or has other characters in it, bundle ID will have "------" where the name of your app should be. I thought it is just a convention for bundle id, to have this in xCode. Turns out, this was my problem, so name your xCode project on English ) I know this is not the case for the most, but anyway)
I tried everything everyone is talking about. I ended up making a guest account first to see if the product ID could be found.... It was. So then I started quitting everything in activity monitor and found the problem. I had to quit the "store" processes below. All of a sudden I stopped getting the invalid product ID. Hope that helps someone out there.