Which Provisioning Profile to use when testing In App Purchase?

血红的双手。 提交于 2019-12-31 17:57:32

问题


I have setup my app in iTunes Connect, with an In App Purchase. It has been 24 hours and I am still getting zero products back from SKProductsRequest.

I am wondering if there is a problem with which provisioning profile I am using. I created a new App ID and used that App ID to create a Development and Distribution Profile using the same App ID. I built the app with the Distribution profile and uploaded it to the app store.

Now I am using the Development profile to test the app - this is where I am wondering if I am making a mistake. Should I not be using the Development profile here? Should I use an Ad Hoc distribution?


回答1:


The big problem is that the interface for In App Purchases seems to change a lot. Here are the steps that worked for me on November 1, 2010:

  • Create a new App ID in the Provisioning Portal
  • Create a Development Provisioning Profile using the new AppID
  • Create a new App in iTunes Connect. Enter the basic info but Do Not upload a binary. Do Not click the 'Ready to Upload Binary' button.
  • Create an In App Purchase Product for the App. The status for the Product should be 'Approved by Developer'
  • In iTunes Connect, return to the App Details and add your new In App Purchase Product to the In App Purchases section of the App Details.
  • Run the project from XCode, using the Development Provisioning Profile you created.

I did this and it worked instantly - though you may need to wait for your In App Purchase Product to propogate through Apple's system.


Tips: I used the code found in this tuorial: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

Make sure your App ID is the base for your In App Purchase Product's ID If your App ID is com.website.app Your In App Purchase Product's ID should be com.website.app.productname

Make sure you have the AppID in your .plist file


The checklist on this page is helpful, though a bit outdated. http://troybrant.net/blog/2010/01/invalid-product-ids/

Here is an updated checklist:

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 Development Provisioning Profile for the new App ID?

Have you configured your project to code sign using this new Development Provisioning Profile ?

Are you building for iPhone OS 3.0 or above?

Are you using the full Product ID when when making an SKProductRequest?

Have you waited several hours since adding your product to iTunes Connect?

Are your bank details active on iTunes Connect? (via Mark)




回答2:


First off, you must run your program on an actual device. The StoreKit API will not work on the simulator.

Before you tear your hair out, read these two pages. They were both EXTREMELY helpful to me in getting In-App Purchasing working. The second link is a straight checklist of things you need to get results back using the StoreKit API.

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

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



来源:https://stackoverflow.com/questions/4074123/which-provisioning-profile-to-use-when-testing-in-app-purchase

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