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.
This one's on me.