![]() |
InApps Android
|
Represents the InApp Service. More...
Inherited by com.ludei.inapps.AbstractInAppService.
Classes | |
| interface | ConsumeCallback |
| Informs when a product is consumed properly or when the process fails. More... | |
| class | Error |
| A class representing an error message. More... | |
| interface | FetchCallback |
| The fetch callback returns a list of the fetched products or an error if the process fails. More... | |
| interface | InAppPurchaseObserver |
| Informs about the purchasing process. More... | |
| interface | InitCompletion |
| Informs when the service is fully initialized and ready to use. More... | |
| interface | PurchaseCallback |
| Informs when a purchase is completed or when the process fails. More... | |
| interface | RestoreCallback |
| Informs when the restoration process fails. More... | |
| interface | ValidationCompletion |
| Informs if the Validation is completed or there was an error in the proccess. More... | |
| interface | ValidationHandler |
| Provides information about the validation proccess. More... | |
Public Member Functions | |
| void | init (InitCompletion callback) |
| Initialize the service and wait for completion Some IAP services like Google Play need to initialize external services. More... | |
| void | addPurchaseObserver (InAppPurchaseObserver observer) |
| Adds a purchase observer. More... | |
| void | removePurchaseObserver (InAppPurchaseObserver observer) |
| Removes a purchase observer. More... | |
| void | fetchProducts (List< String > productIds, FetchCallback callback) |
| Fetches given the list of products from the remote server. More... | |
| List< InAppProduct > | getProducts () |
| Gets the list of all the local products. More... | |
| InAppProduct | productForId (String productId) |
| Returns the product of the given product id. More... | |
| boolean | isPurchased (String productId) |
| Returns true if the product has been purchased and false otherwise. More... | |
| int | stockOfProduct (String productId) |
| Returns the current stock of a given product. More... | |
| void | restorePurchases (RestoreCallback callback) |
| Restores the purchases linked to the user account. More... | |
| boolean | canPurchase () |
| Returns true if the store service is avaialable and false otherwise. More... | |
| void | purchase (String productId, PurchaseCallback callback) |
| Purchases the product. More... | |
| void | purchase (String productId, int quantity, PurchaseCallback callback) |
| Purchases the product. More... | |
| void | consume (String productId, int quantity, ConsumeCallback callback) |
| Consumes a consumable product already purchased. More... | |
| void | setValidationHandler (ValidationHandler handler) |
| Sets the custom validation handler to validate the purchasing process. More... | |
| void | setLudeiServerValidationHandler () |
| Use Ludei's server to validate purchases. More... | |
| boolean | onActivityResult (int requestCode, int resultCode, Intent data) |
| Call it when you receive onActivityResult method in your activity. More... | |
| void | onDestroy () |
| Call it when the activity is destroyed. | |
| void com.ludei.inapps.InAppService.addPurchaseObserver | ( | InAppPurchaseObserver | observer | ) |
| observer | The purchase observer to add. |
| boolean com.ludei.inapps.InAppService.canPurchase | ( | ) |
| void com.ludei.inapps.InAppService.consume | ( | String | productId, |
| int | quantity, | ||
| ConsumeCallback | callback | ||
| ) |
| productId | The product id of the product to consume. |
| quantity | The quantity of the product to consume. |
| callback | The consume callback. |
| void com.ludei.inapps.InAppService.fetchProducts | ( | List< String > | productIds, |
| FetchCallback | callback | ||
| ) |
| productIds | A list of product ids. |
| callback | The fetch callback. |
| List<InAppProduct> com.ludei.inapps.InAppService.getProducts | ( | ) |
| void com.ludei.inapps.InAppService.init | ( | InitCompletion | callback | ) |
| callback | Informs when the service is fully initialized and ready to use |
| boolean com.ludei.inapps.InAppService.isPurchased | ( | String | productId | ) |
| productId | The product id to check. |
| boolean com.ludei.inapps.InAppService.onActivityResult | ( | int | requestCode, |
| int | resultCode, | ||
| Intent | data | ||
| ) |
| requestCode | The request code. |
| resultCode | The result code. |
| data | The data of the activity result. |
| InAppProduct com.ludei.inapps.InAppService.productForId | ( | String | productId | ) |
| productId |
| void com.ludei.inapps.InAppService.purchase | ( | String | productId, |
| PurchaseCallback | callback | ||
| ) |
| productId | The product id of the product to purchase. |
| callback | The purchase callback. |
| void com.ludei.inapps.InAppService.purchase | ( | String | productId, |
| int | quantity, | ||
| PurchaseCallback | callback | ||
| ) |
| productId | The product id of the product to purchase. |
| quantity | The quantity of the product. |
| callback | The purchase callback. |
| void com.ludei.inapps.InAppService.removePurchaseObserver | ( | InAppPurchaseObserver | observer | ) |
| observer | The purchase observer to remove. |
| void com.ludei.inapps.InAppService.restorePurchases | ( | RestoreCallback | callback | ) |
| callback | The restore callback. |
| void com.ludei.inapps.InAppService.setLudeiServerValidationHandler | ( | ) |
To enable validatioon using Ludei's server you first need to create an account in Ludei's Cloud server and create a project with you bundleId.
| void com.ludei.inapps.InAppService.setValidationHandler | ( | ValidationHandler | handler | ) |
| handler | The validation handler |
| int com.ludei.inapps.InAppService.stockOfProduct | ( | String | productId | ) |
| productId | The product id to check. |
156 2nd St., San Francisco CA 94105 © 2015 All rights reserved.Ludei, Inc.