1 #ifndef BLURRR_IN_APP_PURCHASE_H 2 #define BLURRR_IN_APP_PURCHASE_H 5 #if defined(__cplusplus) 10 #ifndef DOXYGEN_SHOULD_IGNORE_THIS 21 #ifdef BIAP_BUILD_LIBRARY 23 #define BIAP_EXPORT __declspec(dllexport) 24 #elif defined(__GNUC__) && __GNUC__ >= 4 25 #define BIAP_EXPORT __attribute__ ((visibility("default"))) 36 #if defined(__clang__) 37 #if __has_feature(nullability) 38 #define BIAP_NONNULL _Nonnull 39 #define BIAP_NULLABLE _Nullable 1266 BIAP_EXPORT
void BIAP_RegisterKey(
enum BIAP_StoreName store_name,
const char* BIAP_NONNULL the_key);
1354 const char* BIAP_NULLABLE nonconsumable_product_identifier_list[BIAP_NONNULL],
size_t num_nonconsumables,
1355 const char* BIAP_NULLABLE consumable_product_identifier_list[BIAP_NONNULL],
size_t num_consumables,
1356 const char* BIAP_NULLABLE subscription_product_identifier_list[BIAP_NONNULL],
size_t num_subscriptions
1681 #if defined(__ANDROID__) 1694 BIAP_EXPORT
bool BIAP_Android_HandleOnActivityResult(
void* BIAP_NONNULL jni_env,
void* BIAP_NONNULL original_activity, int32_t request_code, int32_t result_code,
void* BIAP_NONNULL intent_data);
1700 #if defined(__cplusplus) enum BIAP_EventType BIAP_GetTransactionEventType(struct BIAP_TransactionResponseData *callback_data)
Gets the BIAP_EventType associated with this callback data.
Android.
Definition: BLRInAppPurchase.h:1167
size_t BIAP_GetInvalidProductsListCount(struct BIAP_ProductResponseData *callback_data)
Gets the number of invalid products returned from your product request.
Definition: BLRInAppPurchase.h:1093
Definition: BLRInAppPurchase.h:1086
transaction
Definition: BLRInAppPurchase.h:1125
BIAP_EventType
These event types are given to you for every callback so you distingush the purpose of the event...
Definition: BLRInAppPurchase.h:1120
Definition: BLRInAppPurchase.h:1162
const char * BIAP_GetTransactionOriginalJson(struct BIAP_TransactionResponseData *callback_data)
(Android-only) Gets the JSON formatted receipt for a transaction.
Android.
Definition: BLRInAppPurchase.h:1168
const char * BIAP_GetInvalidProductIdentifier(struct BIAP_ProductResponseData *callback_data, size_t list_index)
Gets a invalid product from a list of invalid products returned from your product request...
transaction, Android-only
Definition: BLRInAppPurchase.h:1137
transaction
Definition: BLRInAppPurchase.h:1149
transaction
Definition: BLRInAppPurchase.h:1139
void BIAP_FreeAppStore(struct BIAP_AppStore *app_store)
Disconnects and frees your app store instance.
BIAP_StoreName
Definition: BLRInAppPurchase.h:1082
Apple.
Definition: BLRInAppPurchase.h:1165
Definition: BLRInAppPurchase.h:1100
void BIAP_Quit(void)
Shuts down the library.
transaction, Android-only
Definition: BLRInAppPurchase.h:1136
void BIAP_FinishTransaction(struct BIAP_TransactionResponseData *callback_data)
For those that require it, notifies the app store that the transaction is finished.
Definition: BLRInAppPurchase.h:1087
const char * BIAP_GetReceiptPath(struct BIAP_AppStore *app_store)
(Apple-only) Gets the path to the receipt on the file system.
enum BIAP_StoreName BIAP_GetAppStoreName(struct BIAP_AppStore *app_store)
Gets the name of the app store you are connected with.
const char * BIAP_GetProductLocalizedPrice(struct BIAP_ProductResponseData *callback_data, struct BIAP_Product *product_object)
Gets the product localized price string for the specified product.
void(* BIAP_TransactionResponse)(enum BIAP_EventType callback_type, struct BIAP_TransactionResponseData *callback_data, void *user_data)
This is the function signature for your Transaction callbacks.
Definition: BLRInAppPurchase.h:1201
const char * BIAP_GetProductDescription(struct BIAP_ProductResponseData *callback_data, struct BIAP_Product *product_object)
Gets the product description string for the specified product.
long long BIAP_GetTransactionPurchaseTime(struct BIAP_TransactionResponseData *callback_data)
Gets the transaction purchase time in milliseconds since Epoch (Unix 1970).
transaction
Definition: BLRInAppPurchase.h:1148
transaction
Definition: BLRInAppPurchase.h:1124
Apple.
Definition: BLRInAppPurchase.h:1163
products
Definition: BLRInAppPurchase.h:1129
Definition: BLRInAppPurchase.h:1089
struct BIAP_Product * BIAP_GetProductWithIdentifier(struct BIAP_ProductResponseData *callback_data, const char *product_identifer)
Searches and returns a valid product from a list of valid products returned from your product request...
void BIAP_FreeTransactionResponseData(struct BIAP_TransactionResponseData *callback_data)
Frees the memory for the BIAP_TransactionResponseData that was created for you in the Transaction cal...
Definition: BLRInAppPurchase.h:1090
transaction, Apple-only
Definition: BLRInAppPurchase.h:1133
Definition: BLRInAppPurchase.h:1094
bool BIAP_IsDebugLogging(void)
Returns whether debug logging is enabled.
const char * BIAP_GetTransactionErrorString(struct BIAP_TransactionResponseData *callback_data)
Gets the error string associated with this callback data.
const char * BIAP_GetProductTitle(struct BIAP_ProductResponseData *callback_data, struct BIAP_Product *product_object)
Gets the product title string for the specified product.
Android.
Definition: BLRInAppPurchase.h:1166
void BIAP_RequestReceiptRefresh(struct BIAP_AppStore *app_store)
(Apple-only) Refreshes the user's purchases receipt on the file system.
enum BIAP_FailedTransactionType BIAP_GetTransactionErrorType(struct BIAP_TransactionResponseData *callback_data)
Gets the BIAP_FailedTransactionType associated with this callback data.
const char * BIAP_GetProductIdentifier(struct BIAP_ProductResponseData *callback_data, struct BIAP_Product *product_object)
Gets the product identifier string associated with this product.
struct BIAP_Product * BIAP_GetProductInList(struct BIAP_ProductResponseData *callback_data, size_t list_index)
Gets a valid product from a list of valid products returned from your product request.
long long BIAP_GetTransactionOriginalPurchaseTime(struct BIAP_TransactionResponseData *callback_data)
(Android-only) Gets the original transaction purchase time in milliseconds since Epoch (Unix 1970)...
Definition: BLRInAppPurchase.h:1099
void BIAP_SetDebugLogging(bool should_enable)
Enables extra debug log messages in the library.
ex: calling RefreshReceipt on Android
Definition: BLRInAppPurchase.h:1170
const char * BIAP_GetTransactionProductIdentifier(struct BIAP_TransactionResponseData *callback_data)
Gets the product identifier string associated with this callback data.
void(* BIAP_ProductResponse)(enum BIAP_EventType callback_type, struct BIAP_ProductResponseData *callback_data, void *user_data)
This is the function signature for your Product callbacks.
Definition: BLRInAppPurchase.h:1191
BIAP_FailedTransactionType
For an error in a transaction event, this sub-type can help you determine the reason for the failure...
Definition: BLRInAppPurchase.h:1158
void BIAP_StartAppStore(struct BIAP_AppStore *app_store)
Starts the app store.
transaction
Definition: BLRInAppPurchase.h:1146
Definition: BLRInAppPurchase.h:1091
Definition: BLRInAppPurchase.h:1097
struct BIAP_ProductResponseData BIAP_ProductResponseData
Definition: BLRInAppPurchase.h:1069
Definition: BLRInAppPurchase.h:1098
struct BIAP_TransactionResponseData BIAP_TransactionResponseData
Definition: BLRInAppPurchase.h:1070
transaction
Definition: BLRInAppPurchase.h:1145
struct BIAP_AppStore BIAP_AppStore
Definition: BLRInAppPurchase.h:1065
void BIAP_Init(void)
Initializes the library.
const char * BIAP_GetProductErrorString(struct BIAP_ProductResponseData *callback_data)
Gets the error string associated with this callback data.
Definition: BLRInAppPurchase.h:1160
transaction
Definition: BLRInAppPurchase.h:1140
void BIAP_FreeProductResponseData(struct BIAP_ProductResponseData *callback_data)
Frees the memory for the BIAP_ProductResponseData that was created for you in the Product callback...
Android.
Definition: BLRInAppPurchase.h:1169
transaction, Apple-only
Definition: BLRInAppPurchase.h:1143
Definition: BLRInAppPurchase.h:1096
Definition: BLRInAppPurchase.h:1085
void BIAP_RegisterKey(enum BIAP_StoreName store_name, const char *the_key)
Allows you to register your public key for the app stores that require it.
Definition: BLRInAppPurchase.h:1092
Definition: BLRInAppPurchase.h:1095
transaction
Definition: BLRInAppPurchase.h:1131
products & transactions
Definition: BLRInAppPurchase.h:1122
bool BIAP_IsInit(void)
Has the library been initialized?
Definition: BLRInAppPurchase.h:1084
bool BIAP_Android_HandleOnActivityResult(void *jni_env, void *original_activity, int32_t request_code, int32_t result_code, void *intent_data)
(Android-only) Call this function in your Android Activity's onActivityResult method.
transaction
Definition: BLRInAppPurchase.h:1141
enum BIAP_EventType BIAP_GetProductEventType(struct BIAP_ProductResponseData *callback_data)
Gets the BIAP_EventType associated with this callback data.
void BIAP_RequestProducts(struct BIAP_AppStore *app_store, const char *nonconsumable_product_identifier_list[], size_t num_nonconsumables, const char *consumable_product_identifier_list[], size_t num_consumables, const char *subscription_product_identifier_list[], size_t num_subscriptions)
Requests product information from your connected app store.
Definition: BLRInAppPurchase.h:1088
size_t BIAP_GetProductsListCount(struct BIAP_ProductResponseData *callback_data)
Gets the number of valid products returned from your product request.
struct BIAP_AppStore * BIAP_GetTransactionAppStore(struct BIAP_TransactionResponseData *callback_data)
Gets the app store handle that this callback originated from.
void BIAP_RestorePurchases(struct BIAP_AppStore *app_store)
Requests all purchases a user has bought from the app store.
struct BIAP_AppStore * BIAP_CreateAppStore(enum BIAP_StoreName store_name, void *native_platform_context, BIAP_ProductResponse product_response_callback, BIAP_TransactionResponse transaction_response_callback, void *user_data)
Creates and starts a connection to the app store.
struct BIAP_Product BIAP_Product
Definition: BLRInAppPurchase.h:1073
void BIAP_PurchaseProduct(struct BIAP_ProductResponseData *callback_data, struct BIAP_Product *the_product)
Purchases the specified product from the app store.
Definition: BLRInAppPurchase.h:1161
transaction
Definition: BLRInAppPurchase.h:1134
products & transactions
Definition: BLRInAppPurchase.h:1127
Apple.
Definition: BLRInAppPurchase.h:1164
void BIAP_ConsumePurchase(struct BIAP_TransactionResponseData *callback_data_of_purchase)
Consumes a consumable purchased product.
struct BIAP_AppStore * BIAP_GetProductAppStore(struct BIAP_ProductResponseData *callback_data)
Gets the app store handle that this callback originated from.