开发者

iPhone app: How to implement in-app purchased game levels

开发者 https://www.devze.com 2022-12-26 13:05 出处:网络
So, I understand that it\'s possible to set up in-app purchases for iPhone apps to purchase non-consumables like game levels. I understand the logic behind the purchase part, but what I don\'t underst

So, I understand that it's possible to set up in-app purchases for iPhone apps to purchase non-consumables like game levels. I understand the logic behind the purchase part, but what I don't understand is, how can I deliver the new game level.

For example: I build an app that contains the first level and they purchase additional levels. Is it better to build all the other levels into the app and whenever they purchase the app, it unlocks it with a plist entry or something? That doesn't seem very update-able to me. Every time I come up with a new level, I'd have to update the app.

So, what I don't understand then, is what is how do I package up a level and download it as a separate entity that can accessed by the game? Would the level just be some XML wit开发者_JAVA技巧h images in a ZIP folder or something? How does the level get added to the game? What are best practices for this type of thing?

I Googled and have found NOTHING about this. I'm a little bit confused by the concept and any help would be appreciated. I'm not looking for someone to write the game for me, I just need pointed in the right direction so I can develop it on my own.


Your game level is whatever you want it to be; you are the designer, after all.

You should look at NSBundle documentation, which can include property lists, image resources (etc) as well as additional code. Package your bundle (zip is convenient), download asynchronously using NSURLConnection, and install be checking the NSDocuments directory for bundles and load with NSBundle.

Or for a simple game level using existing resources, just download a plist that describes it.

You don't need to have your own server; you can download from me.com if you have a MobileMe account, or any similar service.


I would read over the In-App Purchase Programming Guide. It has all the info you need.

In summary: a user will perform the in-app purchase and get a digital receipt from Apple. Your iPhone application should then contact your server to download the new levels, using the receipt as a verification of purchase.

If you don't have a server available to distribute your levels, you might want to consider a third-party service such as UrbanAirship.

0

精彩评论

暂无评论...
验证码 换一张
取 消