Skip to content

Latest commit

 

History

History
 
 

in_app_purchase

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 5.5 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>

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

Supported APIs

  • InAppPurchase.purchaseStream
  • InAppPurchase.isAvailable
  • InAppPurchase.queryProductDetails
  • InAppPurchase.buyNonConsumable
  • InAppPurchase.buyConsumable
  • InAppPurchase.completePurchase (Andriod/iOS-only)
  • InAppPurchase.restorePurchases