In App Purchase works in simulator but not on iPhone - iphone

When I call SKProductsRequest for an in-app purchase on the Simulator title, description, price and ID all come back correctly from iTunes Connect. When I run it on my device, I get invalid product ID.
Any idea why?

I was having same problem.
I couldn't test it because my iPad was jailbroken.
I removed AppSync, and now it works fine! :)

If you delete the app from your iPhone and reinstall, it works. THis matters if you've submitted a previous version of the app for review. Thanks everyone.

Related

InApp Purchase not working in iPhone 5 device

I have implemented In-App Purchase in my app. It is working well on iPhone 4 device, for both iOS5 and iOS6, but is not working on iPhone 5 device.
For iPhone 5, when I click In-App Purchase, the alert to buy the product pops up but is not asking for user id and password.
Any idea about which is the problem? Any help will be appreciated.
thanks..
In iPhone 5, if you are already logged in your iTunes account with your test user account then It won't ask for password.
To disable this feature:
Settings->general->restrictions
And set "require password" to "immediately", it'll ask you for password.
It might help, if not then let me know.
Thanks,
Hemang.
may be in your iPhone 5, you have already mentioned your apple id, for some other purchase through appstore.
you can goto settings and logout your apple id.
I think, you should get the pop up then. :)

iOS In App Purchase - "Invalid Product ID" in release, NOT development version

I created a new app and uploaded the binary to iTunes Connect, then tested IAP using the test user account, both on the simulator and on the device. Both worked.
I submitted the final app and it is currently live on the App Store. However, after deleting the development version from my device and downloading my app from the App Store to test IAP, the app immediately receives an "Invalid Product ID:" error.
Once again, the development version worked using the test user account, but live on the store it does not work and returns invalid product ID. Any ideas what this might be? If anyone wants to test this (in case it's just me) the app is called "ContaX" and is free with ads - you don't need to actually buy the upgrade, just see if it crashes after tapping the remove ads option.
I advise you to wait for 24 hours after your app is approved.
Sometimes it takes more time for the in app purchases to be available in the released application.
I am also suffering with this issue and my app has rejected two time due to this issue. I went to Apple Developer Forum to get the solution. The problem is might be with Review team's device or environment.
Here is the link of full thread: https://devforums.apple.com/thread/233371
I think it will work for you as well.
Double-check the bundle ID you've submitted the app under and the product IDs you're sending to the app. They have to match.
You may have accidentally submitted an app with a different bundle ID.
After fighting this problem for a while I realized I was using the "Apple ID" to get the In App Purchases rather than the "Product ID". So, make sure you're using the "Product ID" and NOT the product's "Apple ID"!
I'd like to share our experience. One of our apps did not have any purchase since release. It was over a month. We have tested in app purchase during development phase in sandbox mode, everything was ok.
When we deleted the development app from our device and installed the app from the app store, we got Invalid product id during purchase.
We double checked everything and tried many things. What we think done the trick is toggle "Cleared for Sale" in the iTunes connect.
We have 3 auto renewing subscriptions. In IAP page, We uncheck Cleared for Sale. then save, then again recheck Cleared for Sale, saved again on each product. remove app from the phone and download again from App Store.
Nothing seems to happen. After 30 minutes suddenly one auto renewing subscription started working. 2 other subscriptions still didn't work. After 5 hours all 3 subscriptions started working magically.
We are seeing something similar. On a new tvOS app with 8 auto-renew subscription IAPs, for the first 30 hours or so after release, none of the IAPs were available. Then one became available and now we are at 40 hours since release with still only 1 of 8 IAPs available.

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.

iPhone StoreKit: in App Purchase: Invalid Product id

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.

Help me on my app version 2

I have one iPhone app in app store, in that application my in app purchase was working correctly.
again submited my another version of application without changing the code but now the in app purchase it is not working...
Please help me out, why my in app purchase is not working actually.
Check Whether it is showing "Clear for sale" status for in app purchase items in itunes.