On Implementing In-App Purchase Using the Corona SDK

Anyone who’s been here before knows that I’m a huge Corona SDK fan, and that it’s the development tool I use to program our iOS (and in the future, Android) games, however, there is one important iOS feature that it doesn’t yet support: In-App Purchases.

It is currently on their roadmap, but there’s really no way of knowing when it will be implemented and I don’t want to just sit here and wait for that to happen.

After implementing Facebook Friend Leaderboards successfully using Corona, I started wondering if I could incorporate some kind of in-app purchase solution as an alternative to Apple’s offering, using my own server for delivery (much like I did with the Facebook leaderboards).

Correct me if I’m wrong, but I believe it’s completely compliant with Apple’s terms if you use UIWebView to conduct your in-app transactions. In Corona, the UIWebView is also known as “Web Popups”.

So after some research, I decided, while I’m waiting for Corona to implement Apple’s in-app purchasing, I’ll simply open up a Web Popup, use PayPal Mobile Checkout (or PayPal Mobile Express Checkout for quicker transactions) to conduct the transaction and then have the app communicate with the server to find out what premium content to “unlock”.

If you’re a PHP/MySQL developer, I highly recommend using the highly affordable Kodingen for a reliable cloud-based solution to host your scripts (that will communicate with your app).

While it won’t be as good as Apple’s one-click checkout option, PayPal is very widespread, easy to use, and it’ll be better than not being able to have any kind of in-app purchases until Corona catches up. Another good thing is that payment is instant with PayPal, so at least there is at least one upside while I’m waiting for the real in-app purchasing to be available in the Corona SDK.

With that said, expect some “in-app purchase” content in some of our coming games (maybe not the next few, but soon after that). If I’m lucky, Corona will support in-app purchases before I’m ready to implement them.

HostGator $3.96

$3.96 for web hosting – used by jonbeebe.net. Get started today.