StoreKit to return all product IDs

被刻印的时光 ゝ 提交于 2019-12-04 01:24:45

You unfortunately have to provide all of the ID's for products you'd like to get information for as far as I could see.

One way to handle this is to store your product ID's on a remote server and then to make a request to the server to pull down the current set of ID's when loading the store.

That would allow you to add or remove products from the itunes side of things and not have to submit any binary updates to your app.

I think you could probably find a happy medium by caching the list of products in the iphone app and then just making a quick request to see if there had been any changes so you wouldn't even have to get the full list each time.

This could be done using a simple http API on the server side or even just an xml file you pull down.

From the In App purchase Programming Guide

Apple recommends you retrieve product identifiers from your server, rather than including them in a property list. This gives you the flexibility to add new products without updating your application.

I have the same problem but I think I have a way to solve it by planning ahead with the product IDs. Instead of naming each product ID something special like "goldSponsor", just number them "1", "2", "3" ... for as many as you want to add. Set the name to "Gold Sponsor" and the description to whatever you want. When your app starts running, request the first N sequential product IDs. If they all are returned as valid, request another N product IDs until you get invalid IDs at which point you are done.

I am planning to do this with Apple hosted content. I am also considering using the description field for the product to encode detailed information about the data I am downloading (in my case the corner coordinates of a map). I will still be using the full "com.company.product.1" for each ID and numbering them sequentially from there.

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