StoreKit In App Purchase invalid product identifiers [duplicate]

拟墨画扇 提交于 2019-11-27 10:35:49
Héctor Ramos

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

I've been compiling a list of the reasons product identifiers come back invalid. Here's a checklist of the potential causes:

http://troybrant.net/blog/2010/01/invalid-product-ids/

The contract for paid applications must be in effect in order to receive data about the in app purchases configured.

This worked for me. I had the exact same problem.

I'm one the the victims here. Well, I was. Yesterday, I had the problem and revised a lot of times all the steps. Today, I reviewed all the list from troybrant.

1) ok my mistake, I forgot to create the proper distribution profile:fixed

2) uploaded a binary and rejected immediatly: they say it works better than no uploading

3) ok, other fix: removed the 10 digits before my domain name from everywhere in xcode (XXXXXXXXXX.com.company.app to com.company.app)

Still not working.

4) Check my device not to be connected with an itunes account.

5) Clean build everytime and remove app from device sometimes

Still not working.

6) Finally, when asking for products, I used only the productID, not the whole com.company.app.productID.

AND it worked.

I think sometimes we have more than 1 mistakes, and when you correct all of them, it's hard to know what was exactly the cause of the problem.

Now I'm happy

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 seems people are getting confused on Product IDs.

You DON'T need to add the whole domain (ex. com.company.product.inappname) for InApp to work.

You MUST use the EXACT Product ID you create on iTunes Connect. In my case, I just created "Product1", used this when SKProductsRequest is called and that's it.

No more pain.

This link has plenty useful information, though is missing this small detail: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

Did u log out of the AppStore from Settings.app? Only when u log out, you will be prompted for logging in again.

Is In-App purchases enabled for your App ID? App ID with wild card (*) cannot be enabled for In-App Purchases. For your app, you should create a new App ID.

My two cents here... http://blog.mugunthkumar.com/coding/iphone-tutorial-%e2%80%93-in-app-purchases/

My problem was the first issue described here:

https://devforums.apple.com/thread/23344?start=0&tstart=0

"First, you need to make sure your app-id in the Portal is correct."

Is your In App Purchase "Cleared for Sale"? That's the setting that I didn't check first time.

Setting the Product Name to the same name submitted to iTunes Connect solved it for me.

I discovered today another thing that can cause this sort of problem. Some times, for strange reasons, the app gets corrupted and all tries to buy something end in error. I solved my problem deleting the app from the device, cleaning the build on Xcode and building it again to the device.

I found that if your application has a different title in another language then you will have this problem unless you set your iPhone language to English. It only happens in development; there doesn't seem to be a problem for production.

I have 15 non-consummable products.

Suddenly, all 15 of them started to appear as 'invalid' in one of my devices (iPod Touch 4G), but valid in the other (iPhone 4S); very weird indeed.

I deleted/reinstalled and now it works OK.

Someone said you must launch from Xcode, but this is not necessarily true. I have many beta testers with AdHoc builds and Test User accounts, and most of the time they seem to be able to purchase OK.

That said, the whole Sandbox Environment is always shaky and has plenty of "down time". Sometimes waiting is the answer.

Just in case someone is still having trouble getting "invalid product id"... Besides everything posted in this topic, I just installed the right debug provision profile, deleted the application from my iPhone, restarted my device and bang, got the product info. I tried this after getting the product info trough the simulator (with the latest XCode now it is possible). I was about to upload the binary and then reject it, but then I tried the above and got it. Hope it helps!

Make sure your "Product Name" in xcode is the same as the app submitted to iTunes Connect.

After struggling for a day or so with invalid products being returned, my solution came down to making sure the purchase item was "Developer approved for sale". Even though there was a green mark next to the item saying "cleared for sale", I still needed to upload a screenshot and select approve.

This seems like a backwards and illogical way of doing things considering I'm still testing my app and not yet ready to put it on sale.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!