The MonkeyStore and Product classes allow apps to perform 'in app purchases' (IAP) on the ios, android and winrt(windows8.1) More...
Methods: |
|
MonkeyStore only currently supports consumable and non-consumables products. Subscriptions and downloadable content are not supported.
The general process for using MonkeyStore in your apps is:
There's a bananas/mak/iaptest demo in the release, but it wont work 'as-is' - you'll need to add a keystore file for android; change the BundleID for ios; change the Product ID for winrt, and change the CONSUMABLES and NON_CONSUMABLES arrays to match your product ids.
Adds multiple new products to the store.
Each element of ids is the Android or iOS 'product id' of the product to add.
type is the product type - consumable or non-consumable.
On iOS, you must ensure that type matches the product type selected in iTunes Connect, otherwise the results will be unpredictable!
On Android, the product type selected in the GooglePlay Developer Console must be 'managed' (MonkeyStore emulates consumable products on Android).
This method may only be called before OpenStoreAsync.
type must be one of:
Type | Description |
---|---|
1 | Consumable product |
2 | Non-consumable product |
Starts an async operation to buy a product.
When the operation completes, the OnBuyProductComplete method of the onComplete object is called.
Note that it is possible to buy the same non-consumable product multiple times, although the user will only be charged for the first purchase. It is up to your app to keep track of purchases and ensure the user is not presented with the option of repurchasing a non-consumable product.
This method may only be called after OpenStoreAsync successfully completes.
Starts an async operation to get an array of all non-consumable products owned by the user.
When the operation completes, the OnGetOwnedProductsComplete method of the onComplete object is called.
This method may only be called after OpenStoreAsync successfully completes.
On iOS, this method may cause an app store 'login' dialog to appear.
Gets the product corresponding to id, the iTunes connect or GooglePlay product identifier.
This method may only be called after OpenStoreAsync successfully completes.
Gets all products.
This method may only be called after OpenStoreAsync successfully completes.
Gets all products of the given type.
This method may only be called after OpenStoreAsync successfully completes.
type must be one of:
Type | Description |
---|---|
1 | Consumable product |
2 | Non-consumable product |
Starts an async operation to open the store.
When the operation completes, the OnOpenStoreComplete method of the onComplete object is called.