in_app_purchase_tizen 0.1.1 copy "in_app_purchase_tizen: ^0.1.1" to clipboard
in_app_purchase_tizen: ^0.1.1 copied to clipboard

Tizen implementation of the in_app_purchase plugin for Samsung Smart TV.

in_app_purchase_tizen #

The Tizen implementation of in_app_purchase based on the Samsung Checkout API.

Supported devices #

This plugin is only supported on Samsung Smart TVs running Tizen 6.0 and above.

Required privileges #

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>
copied to clipboard

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.

Preparation #

Follow these steps before setting up in-app purchases for your application:

  1. 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.

  2. 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.

Usage #

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.2.1
  in_app_purchase_tizen: ^0.1.1
copied to clipboard

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';
copied to clipboard

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>{});
copied to clipboard

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.

Supported APIs #

  • InAppPurchase.purchaseStream
  • InAppPurchase.isAvailable
  • InAppPurchase.queryProductDetails
  • InAppPurchase.buyNonConsumable
  • InAppPurchase.buyConsumable
  • InAppPurchase.completePurchase (Andriod/iOS-only)
  • InAppPurchase.restorePurchases
1
likes
120
points
125
downloads

Publisher

verified publishertizen.org

Weekly Downloads

2024.09.10 - 2025.03.25

Tizen implementation of the in_app_purchase plugin for Samsung Smart TV.

Homepage
Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

crypto, flutter, in_app_purchase_platform_interface

More

Packages that depend on in_app_purchase_tizen