bfgPurchase Class
Static Public Member Functions | |
static bool | acquireProductInformation () |
acquireProductInformation is used when productInformation does not return any data. More... | |
static bool | acquireProductInformation (string productId) |
acquireProductInformation is used when productInformation does not return any data. More... | |
static bool | acquireProductInformationForProducts (List< string > productIds) |
acquireProductInformation is used when productInformation does not return any data. More... | |
static bool | hasDeferredPayments () |
Checks if there are promoted in-app purchases to queue. More... | |
static void | processDeferredPayments () |
Process promoted in-app purchases queued. | |
static bool | canStartPurchase (string productId) |
Test to see if purchase of the specified product can be started. Note that the method is not guaranteed to return false for a product that has already been purchased and should not be used as a substitute for maintaining a proper record of prior purchases. The purpose of the method is to determine whether the unavailability of network connectivity or the state of the SDK precludes purchase of an otherwise eligible product. The method will return false if:
| |
static void | finishPurchase () |
The application uses this method to report that a purchase has been awarded. It should be used only for SKUs that have been registered as consumable with a call to defineConsumableSKUs. The method should be called on the UI thread. Use on Google Purchases ONLY. This method will not do anything on Amazon purchases. | |
static void | finishPurchase (string productId) |
The application uses this method to report that a purchase has been awarded. It should be used only for SKUs that have been registered as consumable with a call to defineConsumableSKUs. The method should be called on the UI thread. Use on Google Purchases ONLY. This function will not do anything on Amazon purchases. More... | |
static bool | isPurchaseActive () |
Indicates whether the purchase process is occurring or not for the default purchase. More... | |
static bool | isPurchaseActive (string productId) |
Indicates whether the purchase process is occurring or not for the purchase of a product with the given ID. More... | |
static bool | isRestoreActive () |
Indicates whether a purchase process is curently being restored or not. More... | |
static bool | productInformation (ref string prodInfoJson) |
Retrieves information about the default product. More... | |
static bool | productInformation (string productId, ref string prodInfoJson) |
Retrieves information about the product with the given id. More... | |
static bool | purchaseActivityInProgress () |
Currently only works on iOS. Checks if a purchase / restore is in progress. Should not be displayed. More... | |
static void | restorePurchases () |
Restores previous purchases. Receives the same NOTIFICATION_PURCHASE_SUCCEEDED notification as the original purchase. | |
static void | startPurchase () |
Convenience method for calling startPurchase:details1:details2:details3:additionalDetails with null details and null additional details. | |
static void | startPurchase (string productId) |
Convenience method for calling startPurchase:details1:details2:details3:additionalDetails with the given productId, null details, and null additional details. More... | |
static void | startPurchase (string productId, string details1, string details2, string details3, Dictionary< string, string > additionalDetails) |
Convenience method for calling startPurchase:details1:details2:details3:additionalDetails with the given productId, null details, and null additional details. More... | |
static bool | startService () |
[iOS-only. Use bfgPurchaseAndroid.setupService() for Android] Calling startService on bfgPurchases enables its functionality and causes it to resume processing any operations that were already in progress. All notification listeners should be set up prior to calling start. More... | |
static bool | startService (ref string error) |
[iOS-only. Use bfgPurchaseAndroid.setupService() for Android] Calling startService on bfgPurchases enables its functionality and causes it to resume processing any operations that were already in progress. All notification listeners should be set up prior to calling start. More... | |
static bool | deliverablePurchases (ref string deliverablePurchasesJson) |
When a purchase completes, you will receive a notification of its success or failure. At this time, award the purchase to the user. This method gives you a secondary way of accessing purchases that should be awarded after the notification has fired. More... | |
static void | forceConsumeAllPurchases () |
WARNING: This is an internal SDK debug method. DO NOT CALL THIS METHOD IN PRODUCTION CODE! | |
Member Function Documentation
◆ acquireProductInformation() [1/2]
| inlinestatic |
acquireProductInformation is used when productInformation does not return any data.
- Returns
- Boolean true is request for product information sent, false is the user is offline.
◆ acquireProductInformation() [2/2]
| inlinestatic |
acquireProductInformation is used when productInformation does not return any data.
- Parameters
productId String productId identifier of product that was purchased in game.
- Returns
- Boolean true is request for product information sent, false is the user is offline.
◆ acquireProductInformationForProducts()
| inlinestatic |
acquireProductInformation is used when productInformation does not return any data.
- Parameters
productIds List<String> productIds identifiers of products that was purchased in game.
- Returns
- Boolean true is request for product information sent, false is the user is offline.
◆ canStartPurchase()
| inlinestatic |
Test to see if purchase of the specified product can be started. Note that the method is not guaranteed to return false for a product that has already been purchased and should not be used as a substitute for maintaining a proper record of prior purchases. The purpose of the method is to determine whether the unavailability of network connectivity or the state of the SDK precludes purchase of an otherwise eligible product. The method will return false if:
- the product id is invalid (null or empty string),
- the network is unavailable,
- the SDK services are unavailable,
- a purchase of the product has been initiated and has not completed,
- restoration of prior purchases is underway,
- no product information has been retrieved for the SKU, or
- user is not signed in (Amazon only).
- Parameters
productId
- Returns
◆ deliverablePurchases()
| inlinestatic |
When a purchase completes, you will receive a notification of its success or failure. At this time, award the purchase to the user. This method gives you a secondary way of accessing purchases that should be awarded after the notification has fired.
- Parameters
deliverablePurchasesJson Purchase objects that were successfully purchased but have not had "finishPurchase" called on them.
- Returns
- If true, the purchase objects were succesfully retrieved. If false, there was a problem with retrieving purchase objects.
◆ finishPurchase()
| inlinestatic |
The application uses this method to report that a purchase has been awarded. It should be used only for SKUs that have been registered as consumable with a call to defineConsumableSKUs. The method should be called on the UI thread. Use on Google Purchases ONLY. This function will not do anything on Amazon purchases.
- Parameters
productId The ID of the product to take off the queue.
◆ hasDeferredPayments()
| inlinestatic |
Checks if there are promoted in-app purchases to queue.
- Returns
- true if promoted in-app purchases are available to queue.
◆ isPurchaseActive() [1/2]
| inlinestatic |
Indicates whether the purchase process is occurring or not for the default purchase.
- Returns
- If true, the default product is currently being processed for purchase. If false, purchase already in-flight, restore in-flight, or other restriction
◆ isPurchaseActive() [2/2]
| inlinestatic |
Indicates whether the purchase process is occurring or not for the purchase of a product with the given ID.
- Parameters
productId ID of product to query if purchase is active.
- Returns
- YES Purchase is being processed. NO Purchase already in-flight, restore in-flight, or other restriction preventing purchase.
◆ isRestoreActive()
| inlinestatic |
Indicates whether a purchase process is curently being restored or not.
- Returns
- If true, restore is being processed or verified. If false, restore in-flight or other restriction preventing restore.
◆ productInformation() [1/2]
| inlinestatic |
Retrieves information about the default product.
- Parameters
prodInfoJson The product id to get the information for.
- Returns
- If true, the ref param received a valid string. If false, the ref param is empty or null.
◆ productInformation() [2/2]
| inlinestatic |
Retrieves information about the product with the given id.
- Parameters
productId The id of the product to get information on prodInfoJson The product id to get the information for.
- Returns
- If true, the ref param received a valid string. If false, the ref param is empty or null.
◆ purchaseActivityInProgress()
| inlinestatic |
Currently only works on iOS. Checks if a purchase / restore is in progress. Should not be displayed.
- Returns
- YES Purchase or restore in progress. NO Purchase already in-flight, restore in-flight, or other restriction preventing purchase.
◆ startPurchase() [1/2]
| inlinestatic |
Convenience method for calling startPurchase:details1:details2:details3:additionalDetails with the given productId, null details, and null additional details.
- Parameters
productId The id of the product being purchased
◆ startPurchase() [2/2]
| inlinestatic |
Convenience method for calling startPurchase:details1:details2:details3:additionalDetails with the given productId, null details, and null additional details.
- Parameters
productId The id of the product being purchased details1 An alpha-numeric label to categorize the event. May be null. details2 An alpha-numeric label to categorize the event. May be null. details3 An alpha-numeric label to categorize the event. May be null. additionalDetails Additional data to be associated with this productId. This value may be null. If not null, the value must be a flat dictionary containing only strings as keys and values.
◆ startService() [1/2]
| inlinestatic |
[iOS-only. Use bfgPurchaseAndroid.setupService() for Android] Calling startService on bfgPurchases enables its functionality and causes it to resume processing any operations that were already in progress. All notification listeners should be set up prior to calling start.
- Returns
- YES Purchase has started. NO Purchase has previously started.
◆ startService() [2/2]
| inlinestatic |
[iOS-only. Use bfgPurchaseAndroid.setupService() for Android] Calling startService on bfgPurchases enables its functionality and causes it to resume processing any operations that were already in progress. All notification listeners should be set up prior to calling start.
- Parameters
error If service fails to start, error will contain the reason. Otherwise error is null.
- Returns
- YES Purchase has started. NO Purchase has previously started.