James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Tags


Twitter


Simplified In-App Purchases for Xamarin iOS and Android

James MontemagnoJames Montemagno

I recently launched Scoreboard for both iOS and Android to help keep score of game scores and it has gone really well as people are using the app and giving really good feedback. When deciding to create Scoreboard I decided to go with an ads based monitization structure with a single ad placed on the main scoreboard page. The first question that came up when friends installed the app was if they could pay to remove ads. My answer was “at this point no, I haven’t looked into in app purchase APIs”. This isn’t a great answer to give so I started researching and implementing IAPs into the apps. This was a rabbit hole of complication, but then Jon Dick (Redth) came to the rescue as he literally just did this for an app and already did an abstraction! An abstraction you say!!! We can make a plugin for it!

After about a weeks work of work in my spare time and lots and lots of testing, I am happy to announce the first release of my latest Plugin for Xamarin, In App Billing.

This first release support iOS and Android purchases of both Non-Consumption and Subscription items with a simple cross-platform API, and it couldn’t be any easier!

Check out this code to make a purchase:

WHHAAAATTTT!!! That is crazy! You just have to track what has been purchased and update your app. In addition to making purchases you can also query informtion about an item and restore past purchases.

You can get the NuGet today and browse the source code on GitHub.

Really Good Docs

I spent tons of time testing and getting this plugin right in my applications and documenting just about everything I could including the crazy complex testing you need to go through. Checkout the GitHub and feel free to open an issue if you have a question.

Listen to the Podcast

This week on Merge Conflict we chat about the state of IAP and the troubles I went through to figure out all it’s crazyness.



What’s Next?

There is already a pull request for UWP, so that will be coming up next in 2.0! Additionally, I will be working on adding a consumption API for developers so you can start adding coins to all your games for people to buy.

Live, Love, Bike, and Code

Comments