GameKit/In App Purchase

I also would really like to see this in Corona very soon. With the ever-increasing competition of the App Store, I think being able to release “free” apps and be able to make a profit with them through in-app purchases is a great opportunity right now. I’m just hoping that in-app purchases are still as effective as they are now by the time the feature is implemented in Corona.

Just look at how well Doodle Dash! did when it was set to free for only a weekend, it rose the to the Top 25 free games in the entire App Store. Imagine if the game was always free, and had in-app purchases, I think it would have made a pretty penny despite it’s “free” status. And I think there’s a lot of others in that same boat.

I can’t wait to see when this pops up in a Corona update :slight_smile: [import]uid: 7849 topic_id: 475 reply_id: 6531[/import]

@Wizem: I too am waiting patiently for In-App Purchase support in Corona. Recently, I found a way to take advantage of the full Facebook API using Corona to create a friends leaderboard, using my own server.

I started thinking of ways I could incorporate some of that into an “alternative” for in-app purchases until Corona officially supports it and I think I found a good alternative to In-App purchases that, aren’t quite as good as having the real thing, but in most situations should suffice. Also, the alternative should be VERY easy to replace once Corona DOES support in-app purchases.

I don’t explain how to do it in my latest blog post, but it describes it vaguely (coincidentally, I just posted it earlier today):

http://jonbeebe.tumblr.com/post/1208865269/on-implementing-in-app-purchase-using-the-corona-sdk

Feel free to post questions if you need a more detailed “how to” … It might not be something you’re looking for, but I’m planning on releasing some “freemium” games as well, and the solution I propose in my blog post will definitely work for me, that is, until Corona supports in-app purchases. [import]uid: 7849 topic_id: 475 reply_id: 6812[/import]

Thank you very much, I’ll start looking into it. If this is a viable alternative, you may have saved me :slight_smile: [import]uid: 8145 topic_id: 475 reply_id: 6813[/import]

Unfortunately, it does not appear to be a viable solution.

http://stadium.weblogsinc.com/engadget/files/app-store-guidelines.pdf

11.2 Apps utilizing a system other than the In App Purchase API (IAP) to purchase content, functionality, or services in an app will be rejected [import]uid: 8145 topic_id: 475 reply_id: 6815[/import]

@Wizem: Thanks for bringing that up. It’s strange, I read several places on the web stating that opening a UIWebView to conduct transactions is allowed; I wonder why so many places are mistaken.

Also, the new PayPal X service is obviously geared toward iPhone in-app purchasing, as well as OpenFeint X (I’m not sure what’s up with all the X’s in terms in in-app purchasing) allows for an in-app purchasing alternative… So I wonder how all that fits in with 11.2 there? [import]uid: 7849 topic_id: 475 reply_id: 6816[/import]

It seems to make sense that it’s not allowed; AFAIK, apple gets a large percent of IAP transactions value. Any system that bypasses IAP, bypasses apple’s income, and they are not interested in distributing apps that don’t bring them any income.

PayPal X seems to be a pretty general API, not geared towards mobile development. Since any payment method other than Apple’s is explicitly prohibited, they don’t seem to fit in with 11.2 at all.

So to write games that need in-game commerce, we need access to IAP from Corona. [import]uid: 8145 topic_id: 475 reply_id: 6817[/import]

What is the status of in app purchases? Are they planned for the next release?

Our team overlooked this problem. We’re making a social game and in-app purchases are the only source of income we planned on. If they are not planned within a month, two - tops, it looks like we’re going to have to give up our current project in Corona.

For this reason, I really need to know what the status of this is. [import]uid: 8145 topic_id: 475 reply_id: 6811[/import]

I think the guys at ansca said they are working on implementing it for the next release. [import]uid: 8192 topic_id: 475 reply_id: 6818[/import]

I heard that same rumor :wink:

We are looking into inApp purchases closely.

I do want to reiterate something when it comes to adding features to Corona. It is not about the degree of easiness or difficulty of the feature, it is about the cross platform integration. Specific device features such as this one, adds a level of complexity due to the very nature of Corona’s cross platform flexibility. The onus is on us on how to make such a feature integrate in two different OS’s, Platform’s while keeping the product’s API consistent as to enable/disable the feature gracefully.

Example

myDeviceSpecificFeature = coronaDeviceSpecificFrameworkAPI(doSomethingMagicalJustforThisDevice);

the sample apil call here should work seamless across the different platforms and exit gracefully when the call is made on a platform where such feature is not supported. If at some point in the future the device that does not support such feature decides to support similar type of feature, this call should work. It is not always the case… but that is Corona’s goal, that level of integration so that you can benefit from the cross platform strategy.

Anyways, without deep diving, I hope you understand what am trying to say.

Carlos [import]uid: 24 topic_id: 475 reply_id: 6854[/import]

@Carlos: That makes perfect sense, but I think something like in-app purchases could benefit BOTH iOS and Android developers, the only difference being with Android, the IAP obviously wouldn’t be handled by Apple.

Perhaps implementation could go something like…

If on iOS, start the in-app purchase api stuff…

and then if on Android device, open web popup to PayPal Mobile Checkout (or Google Checkout?) or some other setting. I know there are a lot of Android/iOS specific *settings* in Corona, so perhaps the in-app purchasing method could be set as some kind of Android-specific setting, but have the function available to both iOS and Android developers (do different things but accomplish the same purpose).

I know that sounds a little complicated, but I guess on your end complicated is what happens when you’re trying to sync two different platforms together.

Whatever you decide, I’m sure implementing in-app purchases for both iOS and Android side of Corona would make everyone extremely happy–myself included.

I really hate that Apple doesn’t allow apps to simply open a web popup, do a PayPal transaction and then enable the service or feature (in-app purchase, just not through apple).

It’s pretty hard to make a bleep in the ever-growing app-store, and I believe in-app purchases helps reward developers for their hard work even more, by allowing us to make money multiple times from the same customer (repeat buyers, without the need to make a whole new game to get a repeat customer). [import]uid: 7849 topic_id: 475 reply_id: 6861[/import]

So, anything I can go on in making a business decision to invest resources into developing a project that depends entirely on IAP, and which we’ve already invested almost two months of work in? :slight_smile:

While I really am optimistic and do like to believe that the “rumor” is true, and the next release will come soon enough for this not to be a commercial failure, I hope you understand my desire for a little more certainty, like an upper time bound on the feature.

Is the cross-platform thing a large enough roadblock to keep it from being released within the next month or two? Or does “looking into it closely” mean this is important enough for AM that they will do what it takes to ship it as fast as possible?

I realize building an abstraction for this is a difficult task, probably with it’s own deep, hidden problems. I personally would be very appreciative of a temporary solution, one that would even be completely deprecated or work differently in future releases due to better cross-platform abstractions, anything half-baked that would just let me leverage IAP.

Please do help me understand your direction better, so I can make a proper decision and not waste precious work time into a project that will not return anything for the time spent. I need to live off of something :slight_smile: [import]uid: 8145 topic_id: 475 reply_id: 6871[/import]

@Wizem: Do you know anything about Kindle app for iphone? I would find it strange if they actually used Apple IAP system, and not the Amazon system that’s used throughout all their services (as well as their actual Kindle device).

If they don’t use the in-app purchase, then I think that is the key to us finding a way around this 11.2 thing. And IF they don’t use Apple’s StoreKit, then HOW do they get away with it?

The thing that got me thinking about that was this article (scroll down to the 11.2 section):

http://www.ilounge.com/index.php/articles/comments/thoughts-on-apples-new-app-store-guidelines/

If you have some premium content in your game, and then close out of the app and open a safari window to your website where they purchase their premium content, and then when you re-open your app it checks the server for the things you unlocked, I wonder if THAT would be okay, since you’re not actually having them purchase IN APP…

I’m wondering–if the Kindle app doesn’t use IAP–if that’s how they do it and get away with it.

If that would work, I think that would be a viable alternative until the feature comes around in Corona. [import]uid: 7849 topic_id: 475 reply_id: 6877[/import]

@Wizem: I did a little more digging into the Kindle iPhone app, and apparently this is the whole scoop:

* Originally, Kindle submitted the app with their own purchasing system within the app, and it got rejected. They were told they need to remove that feature, so they did and Apple approved the app. So the Kindle iPhone app is basically a Kindle book viewer.

* Kindle doesn’t use Apple’s IAP StoreKit because that means they would have to give up 30% of their sales to Apple (I’m sure their profit is already split up as far as it could go so I’m sure they pretty much CAN’T use Apple’s Storekit).

* Instead, within the Kindle app, there is a button that opens up Mobile Safari and takes you to the Kindle store, where you can purchase books that get added to your Kindle account. When you open up the app, the books you purchased through Mobile Safari are viewable in your app (e.g. they are “unlocked”).

So basically, when you open the app, it contacts the amazon server, checks your account for your “premium content” and then allows you to view it through the app. That’s premium content, plain and simple. The books aren’t physical, they are *virtual goods*.

Since we are in the business of searching for ANY kind of in-app purchasing solution until Corona implements the feature full-on, I think we can really learn from Amazon and their Kindle iPhone app (remember, they were rejected for having an “alternative” to in-app purchases within their app, so they implemented it outside of their app and are getting by just fine–I don’t see why we can’t do the same).

With that said, here is my “proposed” workaround that should be no different from the way the Kindle app works. Of course, this is WAY worse than having the real-deal In-App Purchases, but it’s definitely better than having nothing I would assume.

For the sake of the example, let’s say you’re making a “farmville” type app, where you can purchase farming supplies or whatnot to progress.

* When they first launch the app, they create an account as simple as possible… or you can even integrate it with a Facebook login. You have your own online server that your app contacts and it creates their username/password and stores it in your database. That same database will track what premium content they have purchased (more on that in a moment).

* In the app, you have your own virtual currency (as many games do, nothing wrong there) where you can purchase from an in-game store. We’re still in the green area since we’re not dealing with real money at this point.

* You earn more currency as you progress in the game, but it is a long, tedious process.

* In your in-game store, there is a button that says ‘Get More Gold’ (or whatever your in-game currency is called). And where your in-game items/supplies are listed, there is ANOTHER button that says ‘Get Even More Supplies’. No premium items are actually displayed, all the items that are listed are all things that can be purchased using the fake currency, if they want to work for it.

* When they click the ‘Get More Gold’ or ‘Get Even More Supplies’ button, it warns them that they will exit the app and a web browser will show. If they click yes, you save their game state and then open up Mobile Safari to an iPhone-optimized website that lists all kinds of premium items, gold, etc. that they can purchase and have added to their account on your server.

* You conduct payments with any kind of mobile transaction system (google checkout, paypal mobile, amazon, whatever), and when they’re done, they open their app back up and the app contacts the server to make sure that their local app is synced with the items in their account. If not, it simply sets a variable switch in the app to enable certain items (that were not previously shown within the in-game store, but were available in the ‘web store’).

As far as handling the database and communicating with the app, I would personally use PHP/MySQL and a cloud-server such as http://Kodingen.com (which starts off free, just like Google App Engine, and is very affordable once your bandwidth increases… but if you just use it for simple MySQL/PHP transactions then it would take A LOT of users before you have to start paying). But that’s just what I would use, you could obviously use anything you want. You just need SOMETHING to communicate with your app letting you know what the user purchased through your “web store”.

Like I said, I don’t see how that differs AT ALL from the Kindle app.

The Kindle app allows you to view premium content from your Kindle account, that you purchased on the web. Within the app, you can’t browse the premium books, but there is a ‘Get Books’ button which takes you to Mobile Safari where you browse the premium content and purchase whatever you like to your account.

Please let me know if you see any red flags in that whole process I described, Wizem.

I know it’s a HUGE hassle, and something that will likely not be nearly as effective as actual in-app one-click purchases… but it’s better than not having ANY in-app premium unlockable content in my book.

Let me know what you think!

I just hope the Ansca team surprises us and has a new release soon with in-app purchasing :slight_smile: … I think, since Android is open in a lot of ways, that they could bind some kind of in-app purchasing function in Corona to something in android that would match apple’s service similarly. [import]uid: 7849 topic_id: 475 reply_id: 6878[/import]

jonebebe, the Kindle iPhone app has a button that takes you to the Amazon Bookstore. It opens a webview that logs you into your amazon account (linked to a credit card) that lets you browse books. If you click purchase, it closes the webview and the app is notified of the purchase and downloads it right away.

As far as I know this is all possible to build right now in Corona except the notification piece. You would have to point the WebPopup to your own server that calls a Paypal page or Amazon checkout page. The downside to this is the user will have to login every time (unless you ask them once and store it in your app - SCARY THOUGHT…). The other downside is you have to maintain a web server and write an app that handles all of the purchases and digital goods. You’d practically be rewriting OpenFeint X!

The beauty of Apples in-app purchases is that EVERY iDevice is linked to an iTunes account with a credit card. No logins!!! :slight_smile:

I’m going out on a limb here to say that the chances of Ansca implementing OpenFeint X in Corona is pretty slim because it’s still in beta and their cross-platform capability is still in it’s infancy. Although Corona is still pretty young and it WOULD be a great time for Ansca to partner with Aurora Feint and be one of the first (if not THE first) SDK with OpenFeint X built-in. Could you imagine how fast Corona adoption would grow!

On the other hand IAP does not and probably will never work on Android. So according to Carlos’ post above, if they implemented IAP, it would work great on iDevices and just ignore the code on Android devices. That means Corona developers would be hesitant to release free apps to the Android market or possibly a modified codebase for Android. Unfortunately this is probably the best option (at least for the short-term) since the iPhone market is so huge.

I hate to be skeptical, but I personally wouldn’t bet anything on IAP being included in the next release - unless they pull a GameSalad and release the next version 3 or 4 months from now. :smiley: Carlos please prove me wrong here buddy!
[import]uid: 8194 topic_id: 475 reply_id: 6879[/import]

@dknell “pulling a GameSalad” LOL. Promise 2 weeks and deliver in 4 months and don’t tell anyone. Overpromise and Underdeliver. That’s the secret recipe for customer satisfaction.

Let’s not have Ansca overpromise. I am sure they will make an announcement when they can commit.

It seems that OpenFeint allows iPurchases so there is already an example something outside of inApp purchases that is allowed.
One option would be inApp purchases for iOS only and then later implement OpenFeint fully with iPurchases for both iOS and Android.

[import]uid: 8192 topic_id: 475 reply_id: 6882[/import]

Quote @dknell:

“The other downside is you have to maintain a web server and write an app that handles all of the purchases and digital goods. You’d practically be rewriting OpenFeint X!”

I wouldn’t see it as that big of a task. In fact, recently I was able to create a Facebook friends leaderboard in Corona and the premium content thing would work about the same way.

* Create the “web store” (iphone optimized page) and host it on the web server (I mentioned a free cloud server, that charges as your bandwidth goes up, but not by much–and they support PHP).

* They purchase the items, you can easily integrate a third-party mobile payment solution (paypal mobile, for example).

* After purchase, it sends them to a PHP script that simply updates a value that they purchased (ex. hasDairyCow = true).

* When they open the app, it connects to the server to ANOTHER php script that returns a list of all the items the game should unlock (IF its different from the list they have locally).

That’s all actually very simple to do with PHP/MySQL, and also takes up very little bandwidth (I did quite a bit of testing with my Facebook Friends Leaderboard functionality, and among ALL the MySQL queries and calls to the PHP scripts, it only took 0.04mb of bandwidth). So all in all, the task wouldn’t be as complicated as OpenFeint X, as long as you keep things as simple as possible.

Of course, it would all just be a workaround until actual support comes up in Corona…

I think integrating OpenFeint X starting asap is a great idea, since OpenFeint’s ultimate goals are to sync their features with Android and iOS as well. [import]uid: 7849 topic_id: 475 reply_id: 6883[/import]

@dknell, I completely agree with your thought on non-crossplatform payments. To me, this also seems like the best, perhaps necessary, short-term option (“necessary” due to the rate at which the market for iPhone-type smartphone apps is advancing). Changing the payment module for a game that needs it, to deploy for multiple platforms - it should not be a big problem for anyone, but iPhone’s huge market more than compensates for this.

Perhaps I’m a little limited in API-imagination, but I can’t really see a viable cross-platform payment solution, and don’t think it’s as important as being able to leverage iPhone’s large app market.

NOTE: we do kind of plan on distributing on android (after iPhone, due to iPhone’s market being better); before carlos’s reply it didn’t occur to me that the commercial portion of our game would ever be cross-platform. Now, I wouldn’t say I’m particularly interested in it being cross-platform; that would be minor sugar compared to having the general capability to do sales on the iPhone. [import]uid: 8145 topic_id: 475 reply_id: 6881[/import]

You should release a JonBeebe X module for Corona! :wink: I would pay a small fee for it. Let me know if I can help - I’m also pretty good with PHP/MySQL. [import]uid: 8194 topic_id: 475 reply_id: 6884[/import]

@jonbeebe
Thank you again :). I really appreciate the effort you put into helping :slight_smile:

Other than the “Living document” and “Bypass apple’s income” thing, this seems to be legal within the App Store Guidelines. I think selling books which already have a large distribution platform, and selling virtual currency which is the only source of income from a game that intends to be popular are different things to Apple, so I think this is a gray area, rather than a green light by Kindle’s example.

Considering Apple’s hesitation to permit third party development tools (which in this case are the reason for implementing a non-userfriendly virtual currency), I don’t think it will be much of a problem to add a clause that will reject apps that use this seemingly existant freedom to bypass Apple’s income. After all, it’s not an approval checklist, it’s a list of things that get you rejected.

They might not do it, however, and then the only problem will be reduced income due to the inconvenience of buying virtual currency outside the app. My manager believes this will be too inconvenient for users of a Farmville-type application (and you are spot on, we’re developing something ideologically similar :)).

In my mind this is about 5% satisfying :). I.e. there’s a chance it’s possible to do purchases that will be noticeably less profitable. Kind of… not great :slight_smile:

So I too am still hoping AM will surprise us with a quick release. And am also still hoping for something tangible to base my hopes on :). [import]uid: 8145 topic_id: 475 reply_id: 6880[/import]

Lol I wouldn’t charge for it, that’s for sure, especially since it’s just a “temp fix” until the real deal comes out in Corona.

Instead of writing a script, I could give a brief outline of it right here:

* Host the web store as a static webpage (iphone optimized, and matches your app, of course) on Google App Engine instead (there’s lots of tutorials online for getting a static webpage up on google app engine). Why? Because it’s free, it’s highly scaleable & reliable, and you don’t pay anything until you’re getting roughly 5 million pageviews a month. Even then, its really cheap if you go over. But this way, your web store traffic isn’t taking bandwidth away from your PHP/MySQL server that will be doing the “real” work (which really isn’t that much work, and you’ll see).

* Sign up for a free Kodingen.com account. It’s like Google App Engine in terms of scaleability/affordability but it supports PHP/MySQL. It’s in beta, but so far has been working really well for my Facebook Friends Leaderboard feature I’ve been implementing into our iPhone games.

* Once you’ve got your Kodingen account, create a new database, and manage it with phpMyAdmin. Once you’re in there, create a table–let’s say “players”–and start out with these table fields: ID, username, password, cow, horse, chicken.

* The cow, horse, and chicken are “premium only” items inside of your game.

* When the player first opens up the app, they are asked to create a username/password. When they do so, you create a http request to a PHP script that stores their chosen username/password and sets default values for cow, horse, chicken (all set to 0). The cow, horse, chicken will have a value of 0 or 1. 0 indicating that the premium feature is locked, and 1 meaning that it is unlocked.

* The player plays the game and there is an in-game store which they use their fake currency to purchase things. There is also a button in the store that says ‘Get Even More Supplies’. Within the app, the cow, horse, and chicken are NOT displayed in the store because that would be against Apple’s TOS. Instead, they are presented with items that they CAN purchase with their in-game money and also are presented with a very tempting button that says ‘Get Even More Supplies’.

* When they tap ‘Get Even More Supplies’ a native popup comes up letting them know that the app will exit and open up Mobile Safari and direct them to the online store. If they choose to proceed, you save the game state and open up mobile safari to your static “web store” hosted on your Google App Engine account.

* The browse through the items on your web store and decide they want to purchase a COW! They click ‘Purhase’ and it takes them to your Paypal Mobile Checkout process. You set the final purchase redirect URL to be the PHP script on your kodingen account that simply updates their COW entry to 1 (instead of 0), which indicates that the cow should be unlocked.

* When the player is finished with the store, they exit Mobile Safari (which is a natural course of action) and then taps the icon to go back into your app.

* When your app starts, it logs them in and contacts a PHP file on your server which checks the database and sees that the Cow value is no longer a 0, it is a 1. Then, a cow is magically available in their inventory!

And that–in it’s most basic form–is pretty much how it works! You’d obviously have to customize the database to fit the needs of your app, but you can get an idea of the whole process right there.

It’s nowhere near as good as regular in-app purchasing, but I’m sure you’d get a few sales… and at least PayPal’s payments are instant lol. So all in all it’s gotta be better than nothing, and definitely worth a shot while we’re still waiting for Corona to support IAP.

[import]uid: 7849 topic_id: 475 reply_id: 6886[/import]