The Tizen implementation of in_app_purchase
based on the Samsung Checkout API.
This plugin is only supported on Samsung Smart TVs running Tizen 5.5 and above.
To use this plugin in a Tizen application, you need to declare the following privileges in your tizen-manifest.xml
file.
<privileges>
<privilege>http://developer.samsung.com/privilege/billing</privilege>
<privilege>http://developer.samsung.com/privilege/sso.partner</privilege>
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>
</privileges>
The sso.partner privilege is required by the Sso API to internally obtain the user's custom ID (UID). Your app must be signed with a partner-level certificate to use this privilege.
Follow these steps before setting up in-app purchases for your application:
-
Register your application at the Samsung Apps TV Seller Office if you haven't registered yet. You do not need to complete the registration process at this point. Go to the Billing Info page of the app and set the Samsung Checkout checkbox to ON. You can return back to this page and finish the registration process when the final version of your app is ready.
-
Log in to the Samsung Checkout DPI Portal and register your in-app items. You can find your App ID and Security Key in the App Details Setting page. These values will be used as request parameters in your app code.
This package is not an endorsed implementation of in_app_purchase
. Therefore, you have to include in_app_purchase_tizen
alongside in_app_purchase
as dependencies in your pubspec.yaml
file.
dependencies:
in_app_purchase: ^3.1.4
in_app_purchase_tizen: ^0.1.0
Then you can import in_app_purchase
and in_app_purchase_tizen
in your Dart code:
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:in_app_purchase_tizen/in_app_purchase_tizen.dart';
You must call setRequestParameters
to set required parameters before making any plugin API call.
final InAppPurchaseTizenPlatformAddition platformAddition = _inAppPurchase
.getPlatformAddition<InAppPurchaseTizenPlatformAddition>();
platformAddition.setRequestParameters(
appId: 'your_dpi_app_id',
pageSize: 20,
pageNum: 1,
securityKey: 'your_security_key',
);
final ProductDetailsResponse response =
await _inAppPurchase.queryProductDetails(<String>{});
For detailed usage, see https://pub.dev/packages/in_app_purchase#usage and the example app.
For more information on the Samsung Checkout API, visit the following pages.
-
InAppPurchase.purchaseStream
-
InAppPurchase.isAvailable
-
InAppPurchase.queryProductDetails
-
InAppPurchase.buyNonConsumable
-
InAppPurchase.buyConsumable
-
InAppPurchase.completePurchase
(Andriod/iOS-only) -
InAppPurchase.restorePurchases