The Samsung IAP Unity plugin comes with all the content necessary for your integration.
The Plugins folder contains all Samsung IAP related scripts and libraries.
Menu Scene is the Unity scene that demonstrates all the functionality of the Samsung IAP Unity plugin.
Get Started
This section explains how to use Samsung In-App Purchase (IAP) functionality by integrating the Samsung IAP Unity Engine Plugin methods.
System Requirements
To avoid compatibility issues, the plugin requires the following SDKs:
NotePlease double check the version of all the SDKs otherwise it will cause compatibility issues.
Plugin Installation
To import the Samsung IAP Unity plugin into your project, in Unity click Assets -> Import Package.
Plugin Package Overview
The Samsung IAP Unity plugin comes with all the content necessary for your integration.
Plugins folder contains all Samsung IAP related scripts and libraries.
Menu Scene is the Unity scene that demonstrates all the functionality of the Samsung IAP Unity plugin.
NoteFor details about Samsung IAP method calls, see the Programming Guide.
Integrate Samsung IAP Functionality
This section explains the fundamental aspects of integrating Samsung IAP functionality into your Android app by making plugin method calls to support the offering and sale of in-app items.
Samsung IAP Script
Drag-and-drop the Samsung IAP script into the GameObject of your choice.
Set IAP Operating Mode
SetOperationMode() Setting
Description
OPERATION_MODE_PRODUCTION
Mode for normal and beta release
Successful or failure results can be returned for all requests
Caution: Successful purchase requests and payment transactions result in financial billing of the user
OPERATION_MODE_TEST
Mode for app development and testing
Successful or failure results can be returned
Successful purchase requests for licensed testers do not result in payment transactions or financial billing
Purchase requests for users who are not licensed testers result in an error message displayed
For requests that succeed, successful results are returned
For requests that fail (for example, due to network issues), failure results are returned
OPERATION_MODE_TEST_FAILURE
Mode for app development and testing
Failure results are returned for all requests
Purchase requests do not result in in payment transactions or financial billing
During app development and testing:
Either test mode can be set.
OPERATION_MODE_PRODUCTION mode must not be set.
CautionIf production mode is set, all requests are blocked and an error is returned.
For beta release:
OPERATION_MODE_PRODUCTION mode must be set.
All beta testers download paid beta apps for free.
Beta testers who are not whitelisted will be financially billed for in-app items, and they can test in-app purchase functionality.
Beta testers who are whitelisted get in-app items for free, but they cannot test purchase functionality.
For validation testing and for normal release:
OPERATION_MODE_PRODUCTION mode must be set prior to submitting an app and its in-app items to validation testing.
CautionIf OPERATION_MODE_TEST mode is set, purchase requests for paid apps and in-app items will not result in financial billing of the whitelisted user.
If OPERATION_MODE_TEST_FAILURE is set, all requests will fail.
Use the GetProductsDetails() method to get detailed information (for example, item ID, price, and description) about some or all of the in-app items registered to your app that are available for user purchase:
Specify one or more unique in-app item ID values (comma delimited) to get information about the specified items.
Specify an empty string ("") to get information about all registered items.
Sample code:
//Get information about three in-app items
SamsungIAP.Instance.GetProductsDetails("com.mygame.product1, com.mygame.product2, com.mygame.product3", OnGetProductsDetails);
//Get information about all in-app items
SamsungIAP.Instance.GetProductsDetails("", OnProductsDetails);
After processing is complete, the OnGetProductsDetails callback is triggered, which contains information about the specified items and API call processing.
Initiate a Purchase and Payment Transaction
Use the StartPayment() method to initiate a purchase and payment transaction for a specified in-app item.
You can specify your own pass-through parameter and use it for purchase and payment verification.
After processing is complete, the OnPayment callback is triggered,
which contains information about the purchased item, the transaction, and API call processing.
Enable a Purchased Consumable Item to be Purchased Again
Use the ConsumePurchasedItems() method and the purchase ID of a consumable in-app item to enable it to be purchased again (whether or not the user has actually used the item).
Your app receives an item's purchase ID in the OnPayment and OnGetOwnedList callbacks. Sample code:
After processing is complete, the OnConsume callback is triggered,
which contains information about the consumed item and API call processing.
Query Previously Purchased Items
Use the GetOwnedList() method to get information about some or all of the items the user has already purchased:
GetOwnedList() Setting
Description
item
Returns all purchased non-consumable items, and consumable items that have not been consumed
subscription
Returns all purchased subscription items with active subscriptions
all
Returns all purchased non-consumable items, consumable items that have not been consumed, and subscription items with active subscriptions
NotePurchased consumable items that were previously reported as consumed are not returned. Purchased subscription items with expired subscriptions are not returned.
After processing is complete, the OnGetOwnedList callback is triggered, which contains information about the specified purchased items and API call processing.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.