Sponsored By

Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs.

Thanks to one line of code, I accidentally left a way to unlock all the in-app purchases for free in the shipped version of my iOS game, Got Light?. Stress-testing your games is crucial, especially when it's about something as important as monetization.

Ben Reynolds, Blogger

August 9, 2014

2 Min Read

I was watching a friend play my iPhone game today. Naturally, it's always satisfying to watch someone play something you've made, so I was feeling pretty good about myself.

That is, until he found a trick to unlock all the in-app purchases in my game for free. 

To make it clear, this is a game I recently released on the App Store after over a year of development time. After spending that much time working on a game, one might think the disastrous bugs would have been squashed by now. Nope, not a chance.

Here's the scoop: My game (Got Light?) is free to download, but usually costs $1.99 to get past a paywall after Level 28; this lets you play all 73 levels. Like all developers with in-app purchases, I included a "Restore Purchases" button in the game to let you re-unlock what you already paid for. When I was developing the game, I had this button activate the testRestorePurchases method in my code, which grants the tester the full version of the game for free, rather than the restorePurchases method, which asks Apple whether they've paid. You can see where this is going. As fate would have it, I forgot to switch out the test code before I submitted the game. 

As a result, you can open my game, tap on Restore Purchases, and then BOOM, you just snatched a $1.99 game for free.

Got Light Full Game Unlock for Free Screenshot


Why am I writing about this? To share a lesson learned: stress-test your game. Especially with something as important as monetization. The problem was literally one line of code. The Restore Purchases button is fairly out-of-the-way in my app, so I didn't catch it when I was just playing the game out of habit.


It's also great if you have a lot of playtesters, especially the type of people who love to break things. Friends typically aren't great playtesters because they give you sugar-coated feedback, but if you have "that one friend who always tries to find loopholes in everything" you should definitely have him or her take a look at your game. They'll enjoy breaking it, and you'll enjoy not releasing a broken version of your game.


I've submitted an update to Apple that will fix the bug and prevent these downloads, but until the update is approved the loophole still exists.


Go ahead; download it, tap the "Restore Purchases" button, and get the whole game for free.

This one's on me.

Read more about:

Featured Blogs

About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like