New this build: a multiplatform in-app purchases (IAP) plugin! Previously it has been difficult to set up IAP in games, requiring different plugins and events for each platform you want to publish to. This plugin aims to eliminate that work, having a single set of events for a single object that handles IAP on whichever platform you export to. The initial release of this plugin has support for the Windows Store, CocoonJS, Blackberry 10, Amazon Appstore, and Tizen. Other platforms are not yet supported, but we will be looking in to adding support for others in future. And when we do, the same set of events should work for that platform as well, making porting a lot easier.
There's no documentation for this plugin yet but the basic usage is as follows:
- On start of layout, use the Add product ID action to add the product IDs you will be using, e.g. "product1,product2,product3". (This is necessary since some platforms don't support requesting a list of available product IDs.)
- After that (still on start of layout), use the Request store listing action. This downloads the names and prices of the given products. (Again, this is necessary since some platforms don't support making purchases until this information has been received.)
- When On store listing success triggers, the product names and prices are available, and purchases can start being made or checked with Has product.
You can also flip the 'Test mode' property like you can with the Windows 8 object. This enables 'test', 'developer' or 'sandbox' mode on the appropriate store for testing. Don't forget to turn off test mode when publishing!
Note some platforms will have quirks: one that is possible is that some platforms might not update the status of the Has product condition until a few moments later, so try checking it regularly if it's not doing what you expect.
This is a pretty complicated plugin internally, even if it looks simple, because each store works differently with a completely different API. We've done our best to wrap everything in a consistent way so it seems to work the same everywhere, but there may be variations between platforms. It's also a difficult plugin to test since it has to be published all the way to the store to verify that it works. Please let us know if you run in to any issues.
Note the IAP plugin does not appear in the free edition. This is because the free edition is not allowed to be used for commercial purposes.