In-App Purchases

In the iTunes Connect Developer Guide, of the various reasons for making use of In-App purchases, I am interesed in two:

  1. A basic version of your app with additional premium features.

This could easily be done in ANSCA Corona by just setting certain flags in your app that turns on the premium features

  1. A game that offers new environments (levels) to explore.

This could also be done by just setting certain flags in your app that allows access to the ‘new’ levels, as long as the levels were already there. But what about DOWNLOADING new levels. Would this be a violation of the iPhone App Store rules? (It would be the same as downloading executable code that could possibly be used maliciously.) [import]uid: 295 topic_id: 5040 reply_id: 305040[/import]

As long as this thread is here, I have some questions of my own about In-App purchases in Corona. Since that update hasn’t actually dropped yet I understand if you can’t talk about it yet.

Do In-App purchases require work outside Corona? My understanding of In-App purchases for native apps is that you have to write a web-service (maybe Python code on Google App Engine) and the iPhone app communicates with your web-service to handle purchases. Mind you, I’ve never done anything with In-App purchases before; that’s what I’ve read elsewhere, but it seems more complicated than necessary so I’m hoping I got it wrong. [import]uid: 12108 topic_id: 5040 reply_id: 16575[/import]

It would be the same as downloading executable code that could possibly be used maliciously.

um, well if your level includes executable code then that wouldn’t just be the same, what’s literally happening is downloading executable code. So obviously that means your level can’t have executable code in it.

There are two separate issues to bear in mind here: one is how to add code to your game for new features, and two is how to add levels without new code. The first issue is what app updates are all about; if any of your levels need code not already in your app, then add that new code and publish an update.

The second issue is a problem if you think levels ARE code. That can seem to be the case in the samples on Corona’s website because all the levels in the samples are hard-coded, but there’s no particular reason they need to be. Instead of hard-coding the level, have the level code written generically* and read in JSON or XML or something that tells it where to place all the objects. Now your in-app purchase is the XML for the level, not the level’s code.

*“Ok computer, loop through all the enemies in the level and update them!”
“How many enemies are there?”
“I dunno, loop through all of them.” [import]uid: 12108 topic_id: 5040 reply_id: 16574[/import]

jhocking. In the official Apple documents, there are two ways. The work outside Corona that you mention is the Server Model. But the Built-in model is easier, and doesn’t require a server nor work outside Corona (other than setting up your iTunes Dev account for in-app purchases). In addition to Apple’s documentation I found quite a few tutorials:

http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk-in-app-purchases/

This one describes the Built-In Product Model distribution strategy before describing the more complicated Server Product Model.
[import]uid: 295 topic_id: 5040 reply_id: 16582[/import]

ah okay that is good to know. When I read that article it will probably explain, but in the meantime why would you opt for the Server model instead of Built-in? Presumably Built-in has some limitations that Server overcomes; what are those limitations? [import]uid: 12108 topic_id: 5040 reply_id: 16583[/import]

One example given is subscriptions. A monthly magazine - the new monthly content data could be download to your iOS app from your company’s server. This monthly data couldn’t be built-in.

Another is newly designed game levels. Game levels could be continued to be designed for months/years after the game was first sold on the App Store. Getting the levels to a previously purchased game from a server would save the developer the trouble of re-submitting anew version of the game to the App Store every time a new level is designed. [import]uid: 295 topic_id: 5040 reply_id: 16584[/import]