iPhone StoreKit: in App Purchase: Invalid Product id - iphone

I know this question has been asked before but I am still facing issues with the in app purchase.
I have read the apple document, followed the checklist of http://troybrant.net/blog/2010/01/invalid-product-ids/
But I am still facing problem in making the in app purchase to work.
I followed a video tutorial to create the StoreKit, my codes are fine. When I do NSLog for
NSLog(#"Invalid productRequest count %d", [response.invalidProductIdentifiers count]);
The result: Invalid productRequest count 1
I have submitted the binary code and rejected it. I hope this is not an issue for the IAP to work.
What I am doing different in order to make the in App Purchase to work.
Can someone kindly advice me if I am making a mistake or what should I do to ensure the iap to work.
Your response will be much appreciated.
Thank you.

if you are working on jailbroken device, I'd suggest you to restore factory version and try again. Somewhat jailbroken device has an issue to run testing in app purchase in sandbox.

The steps taken to make the in-app-Purchase to work:
1) Created unique App ID: com.yakimbi.inAppPurchase
2) Created Provisioning Profile, download and installed it.
3) Add the application to iTunes Connect App Store.
4) Upload the app binary file, and rejected it. The status is Developer Rejected.
5) The product is added in Manage You in App Purchase, ProductID is com.yakimbi.inAppPurchase.ProductTest1, created as non-consumable item.
6) Wrote the StoreKit code to request the Product.
7) Waited for more then 48hours once the product is added.
8) Created a Test User account.
9) Updated the code with supporting transaction.
10) Sign Out my account on the device.
11) Run the app on the device.
12) But I get inValidPurchaseIdentifier count 1.
13) Never got prompted for username and password.
What steps have I left out while creating this. I hope someone could guide me. Thank you.

Try to remove the app manually from the device.
Sign out of your account on the device.
Then reset the device and try again.
These worked for me.

Restarted my Macbook, and it worked.

Related

I have Registered App ID but still it shows You have no eligible Bundle IDs for iOS apps. Register one here

I have Registered AppID.
Using Wild card and without Wold card also.
this is not first time i am creating app ID and submitting it on appstore.
But after registering appID on developer.apple.com
and when i try to add new app on itunesconnect.apple.com
it all time shows "You have no eligible Bundle IDs for iOS apps. Register one here."
I have created 4 appId for This.but till msg not disappears.
Logging out and back in of iTunes Connect fixed this for me.
seems a problem with iTunes Connect Contracts and payments. Here is a quote
Had the same problem. Just had to update my contract & tax info and accept the new iAd contract and everything worked again (Even though I don't want to use iAd at all).
Seems to be working for them. Not sure though.I am gonna check it out.
I guess there is something wrong with iTunes Connect now. I can't add new app either. Itunes connect doesn't see any of my recently added APP_STORE provisioning profiles.

Cannot connect to iTunes store error

Well, I'm having this issue now. I'm using MKStoreKit in my in-app purchase. This are my errors:
Failed transaction: <SKPaymentTransaction: 0x136a62e0>
error: Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x13654a90 {NSLocalizedDescription=Cannot connect to iTunes Store}
Any idea?
You may remove that error via cross checking this check list.
If your answer is no for any of the points then it may be causing the problem
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Does your project’s .plist Bundle ID match your App ID?
Have you generated and installed a new provisioning profile for the new App ID?
Have you configured your project to code sign using this new provisioning profile?
Are you using the full product ID when making an SKProductRequest?
Have you waited several hours since adding your product to iTunes Connect?
Are your bank details active on iTunes Connect?
Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work.
For iOS7 and Xcode 5 Try doing this:
You have to test on a physical device as apple restrict IAP testing in the simulator.
Go to setting -> iTunes & App Store -> and log out of your account.
Remove app from device and clean all data.
Most importantly do logout from your current iTunes account in your device before trying to do any purchase.
Make sure you have done all necessary steps for in-App purchase testing.
As of September/October 2013, iOS7 simulators cannot process app store inapp purchase requests.
You need to use a real device
Imagine, you created new app profile in My Apps of itunes connect. Added in-app. All correct.
Now you want to test purchases. It shows list of products but stops on buy button with "Cannot connect to iTunes Store" error in log.
This is because you try to buy not approved and not existing product!
You can test only sandbox product right now.
So, you have to
create sandbox user (in itunes connect - users...)
logout you real itunes login on device
try to buy under sandbox login (it will ask you)
Had same issue and I just remembered not any apple id will work. You have to create a testing apple id in itunes connect / manage users/ test user / add new user.
Try putting a build number in. Target > General > Identity > Build.
This solved it for me.

What is necessary to upload to iTunes Connect for Store Kit testing?

Most tutorials I've been able to find are dated and inconsistent with regard to what is actually necessary to have uploaded and approved in iTunes Connect. Following one tutorial I uploaded incomplete binary and rejected it. I then added an In App Purchase Item. I uploaded an image and filled in all the registration information.
So currently,
App - Status -- Developer Rejected
In App Purchase Item -- Ready to Submit
I am able to make requests to the store kit, but I am getting 0 results. Is it possible to get results with my current iTunes Connect statuses?
Edit: I appreciate the trouble shooting advice. But I want to make sure that it is in fact possible to retrieve purchase items with the above statuses.
Make sure that you provided all the details for the app including the in app purchase details along with screen shot.
Next is to make sure that the app ID's are same in server and in the app.
When testing in-app purchase, create test account in app store and use it for testing. Make sure that the mail you are using is not existing. Also on your device, you have to use those test credentials to test the app.
Hope this helps.
Yes, it is possible as I just managed to do it. My problem was tax info. Thanks to Paul Mason, your comment was the correct answer!

StoreKit Sandbox Testing Doesn't Prompt to Log in

I'm testing an in-app purchase which did work fine a week ago, but now seems to be playing up.
I can load the product from the store without any problems (using NSLog to confirm the product id, price etc...), but when I send the actual request to purchase the product - I don't get challenged to log in to my (test) user account, it just returns an error code -1003 "Cannot connect to iTunes store".
This is strange because it did work a week ago, and now it doesn't. What's weirder is that it does prompt me for my password (to purchase the product) if I am currently logged into my live iTunes account.
It's almost as if the app is checking to see if there is an iTunes account logged in, and if not it will just fail... which is rather annoying as you're not supposed to log into the test accounts via your settings as it will invalidate it.
Can anyone shed some light on this for me? I'd be well chuffed if you could :)
Thanks!
I have had this issue as well. You may want to try one or all of these steps.
Delete the app from your device and rebuild it.
Log out from any iTunes account on the device.
Delete the app. Reboot your device and build and run again.
Log into the iTunesConnect portal and view your test user page.
I have been able to reconnect by doing one or all of these things.
Hope this helps.
I've fixed this by creating a new test user. My guess is the test account accidentally saw the live store - which tends to kill them. Might be your problem as well?

In app purchase does not work when live

I have an app in the app store that I have added an in app purchase for, I fully tested it in the sandbox environment and all worked fine. I have had the app update and the in app purchase approved by apple and according to iTunes connect all has gone live. The app updates just fine but then in app purchase simply doesn't work!! No products are returned! Anyone else have this problem? Surely if it worked in the sandbox and apple has approved it, there should be no issues!?
It's all working just fine now! I didn't do anything it just seems to have taken about 36 hours for the in app purchase product to propagate through apples servers! :)
We just went live about an hour ago with the EXACT same issue. Everything worked during testing and even when Apple reviewed the application. I even verified they completed test purchases via analytics. But when users in the app store download the update, try to buy the feature it just fails.
My only guess is our store data has propagated to their live servers? The apps are still using the sandbox environment?
Which URL are you using to connect to the Apple servers?
The sandbox url is:
https://sandbox.itunes.apple.com/verifyReceipt
When launching the app or going live the url needs to be changed to the live Apple servers:
https://buy.itunes.apple.com/verifyReceipt
This has got nothing to with the receipts or anything. If it was working in the Sandbox mode, it's gonna get automatically fixed in around 24 hours in the live version, don't worry. The exact same thing happened to us and we could do nothing but wait...
Also, make sure the iTunes account on your device is set to your real account. If you are are still logged into a test user from when you were testing your IAP stuff, your purchases won't work.
So incase a where in app purchase in your app not working past 48 hrs, kindly visit developer.apple.com to update your tax information. In app purchase won't function until the in app purchase is updated even the app is live too.