Samsung Wearable Native API
|
Functions | |
int | iap_galaxyapps_start_payment (const char *item_id, iap_galaxyapps_mode_e mode, iap_galaxyapps_reply_cb reply_cb, void *user_data) |
Purchases an item on Samsung Galaxy Apps. | |
int | iap_galaxyapps_get_item_list (int start_number, int end_number, const char *item_type, iap_galaxyapps_mode_e mode, iap_galaxyapps_reply_cb reply_cb, void *user_data) |
Gets the list of a specified subset of the items on Samsung Galaxy Apps offered for sale by caller app. | |
int | iap_galaxyapps_get_purchased_item_list (int start_number, int end_number, const char *start_date, const char *end_date, iap_galaxyapps_reply_cb reply_cb, void *user_data) |
Gets the list of the purchased items on Samsung Galaxy Apps. | |
int | iap_galaxyapps_get_purchased_item_list_by_item_ids (const char *item_ids, iap_galaxyapps_reply_cb reply_cb, void *user_data) |
Gets the list of the purchased items among item_ids on Samsung Galaxy Apps. | |
int | iap_galaxyapps_get_value (iap_galaxyapps_h handle, const char *key, char **value) |
Gets value associated with the given key. | |
int | iap_galaxyapps_foreach_item_info (iap_galaxyapps_h handle, iap_galaxyapps_item_info_cb callback, void *user_data) |
Retrieves all items contained in handle. | |
Typedefs | |
typedef struct iap_galaxyapps_s * | iap_galaxyapps_h |
In-App Purchase handle. | |
typedef void(* | iap_galaxyapps_reply_cb )(iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data) |
Called when the reply of the In-App Purchase request is delivered. | |
typedef bool(* | iap_galaxyapps_item_info_cb )(iap_galaxyapps_h handle, void *user_data) |
Called to retrieve all item information contained in the handle. |
The In App Purchase APIs provide functions to purchase an item and get item list.
#include iap_galaxyapps.h
Purchases an item on Samsung Galaxy Apps and Gets the list of a specified subset of the items and the purchased items.
This API is related with the following feature:
typedef struct iap_galaxyapps_s* iap_galaxyapps_h |
In-App Purchase handle.
typedef bool(* iap_galaxyapps_item_info_cb)(iap_galaxyapps_h handle, void *user_data) |
Called to retrieve all item information contained in the handle.
[in] | handle | The In-App Purchase handle |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop typedef void(* iap_galaxyapps_reply_cb)(iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data) |
Called when the reply of the In-App Purchase request is delivered.
[in] | reply | The In-App Purchase handle in which the results of the callee are contained |
[in] | result | The result code of the In-App Purchase request such as IAP_GALAXYAPPS_ERROR_NONE Successful IAP_GALAXYAPPS_ERROR_PAYMENT_IS_CANCELED Payment canceled IAP_GALAXYAPPS_ERROR_INITIALIZATION Failure during IAP initialization IAP_GALAXYAPPS_ERROR_NEED_APP_UPGRADE Samsung IAP upgrade is required IAP_GALAXYAPPS_ERROR_COMMON Error while running IAP IAP_GALAXYAPPS_ERROR_ALREADY_PURCHASED Error when a non-consumable product is repurchased or a subscription product is repurchased before the product expiration date. IAP_GALAXYAPPS_ERROR_REQUEST_PAYMENT_WITHOUT_INFO Error when payment is requested without bundle information. IAP_GALAXYAPPS_ERROR_PRODUCT_DOES_NOT_EXIST Error when the requested item list is not available. IAP_GALAXYAPPS_ERROR_CONFIRM_INBOX The payment result is not received after requesting payment from the server, and the purchased item list is not confirmed IAP_GALAXYAPPS_ERROR_NETWORK_NOT_AVAILABLE Error network is not available. IAP_GALAXYAPPS_ERROR_IO_ERROR IOException IAP_GALAXYAPPS_ERROR_TIMED_OUT Timeout exception IAP_GALAXYAPPS_ERROR_NOT_EXIST_LOCAL_PRICE The item is not for sale in the country IAP_GALAXYAPPS_ERROR_NOT_AVAILABLE_SHOP IAP is not serviced in the country |
[in] | user_data | The user data passed from the callback registration function |
Enumeration for In-App Purchase Error.
Enumeration for mode.
int iap_galaxyapps_foreach_item_info | ( | iap_galaxyapps_h | handle, |
iap_galaxyapps_item_info_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all items contained in handle.
This function calls iap_item_info_cb() repeatedly for each item information contained in handle.
If the iap_item_info_cb() callback function returns false
, then iteration will be finished.
[in] | handle | The In-App Purchase handle |
[in] | callback | The iteration callback function |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
int iap_galaxyapps_get_item_list | ( | int | start_number, |
int | end_number, | ||
const char * | item_type, | ||
iap_galaxyapps_mode_e | mode, | ||
iap_galaxyapps_reply_cb | reply_cb, | ||
void * | user_data | ||
) |
Gets the list of a specified subset of the items on Samsung Galaxy Apps offered for sale by caller app.
[in] | start_number | the index of first item on the list |
[in] | end_number | the index of last item on the list |
[in] | item_type | the item type such as 00, 01, 02 and 10 00: Non-consumable, 01: Consumable, 02: Subscription, 10: All |
[in] | mode | It can be possible to experience the entire process 'risk free' by enabling the IAP Test Mode when developing apps. Be sure to set IAP_GALAXYAPPS_COMMERCIAL_MODE when uploading an application for distribution so that actual payments from customers can be completed. |
[in] | reply_cb | The result callback function |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INITIALIZATION | Failure during IAP initialization |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
IAP_GALAXYAPPS_ERROR_NOT_SUPPORTED_DEVICE | The device does not support IAP |
IAP_GALAXYAPPS_ERROR_OUT_OF_MEMORY | Out of memory |
IAP_GALAXYAPPS_ERROR_PERMISSION_DENIED | Permission denied |
int iap_galaxyapps_get_purchased_item_list | ( | int | start_number, |
int | end_number, | ||
const char * | start_date, | ||
const char * | end_date, | ||
iap_galaxyapps_reply_cb | reply_cb, | ||
void * | user_data | ||
) |
Gets the list of the purchased items on Samsung Galaxy Apps.
[in] | start_number | the index of first item on the list. it starts from 1. |
[in] | end_number | the index of last item on the list |
[in] | start_date | the start date of the requested inbox list. the date format is "yyyymmdd". ex) "20160301" |
[in] | end_date | the end date of the requested inbox list. the date format is "yyyymmdd". ex) "20160331" |
[in] | reply_cb | The result callback function |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INITIALIZATION | Failure during IAP initialization |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
IAP_GALAXYAPPS_ERROR_NOT_SUPPORTED_DEVICE | The device does not support IAP |
IAP_GALAXYAPPS_ERROR_OUT_OF_MEMORY | Out of memory |
IAP_GALAXYAPPS_ERROR_PERMISSION_DENIED | Permission denied |
int iap_galaxyapps_get_purchased_item_list_by_item_ids | ( | const char * | item_ids, |
iap_galaxyapps_reply_cb | reply_cb, | ||
void * | user_data | ||
) |
Gets the list of the purchased items among item_ids
on Samsung Galaxy Apps.
[in] | item_ids | Item IDs seperated by comma(,) |
[in] | reply_cb | The result callback function |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INITIALIZATION | Failure during IAP initialization |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
IAP_GALAXYAPPS_ERROR_NOT_SUPPORTED_DEVICE | The device does not support IAP |
IAP_GALAXYAPPS_ERROR_OUT_OF_MEMORY | Out of memory |
IAP_GALAXYAPPS_ERROR_PERMISSION_DENIED | Permission denied |
int iap_galaxyapps_get_value | ( | iap_galaxyapps_h | handle, |
const char * | key, | ||
char ** | value | ||
) |
Gets value associated with the given key.
[in] | handle | The In-App Purchase handle |
[in] | key | The name of the extra data |
[out] | value | The value associated with the given key |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
IAP_GALAXYAPPS_ERROR_KEY_NOT_FOUND | Specified key not found |
int iap_galaxyapps_start_payment | ( | const char * | item_id, |
iap_galaxyapps_mode_e | mode, | ||
iap_galaxyapps_reply_cb | reply_cb, | ||
void * | user_data | ||
) |
Purchases an item on Samsung Galaxy Apps.
[in] | item_id | the item id to purchase |
[in] | mode | It can be possible to experience the entire process 'risk free' by enabling the IAP Test Mode when developing apps. Be sure to set IAP_GALAXYAPPS_COMMERCIAL_MODE when uploading an application for distribution so that actual payments from customers can be completed. |
[in] | reply_cb | The result callback function |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value IAP_GALAXYAPPS_ERROR_NONE | Successful |
IAP_GALAXYAPPS_ERROR_INITIALIZATION | Failure during IAP initialization |
IAP_GALAXYAPPS_ERROR_INVALID_PARAMETER | Invalid parameter |
IAP_GALAXYAPPS_ERROR_NOT_SUPPORTED_DEVICE | The device does not support IAP |
IAP_GALAXYAPPS_ERROR_OUT_OF_MEMORY | Out of memory |
IAP_GALAXYAPPS_ERROR_PERMISSION_DENIED | Permission denied |