flutter_onestore_inapp 0.2.0 flutter_onestore_inapp: ^0.2.0 copied to clipboard
A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the ONEstore.
flutter_onestore_inapp #
A flutter plugin for ONE store In-App Purchase.
For more information, see the Developer Center.
Getting started #
Pre-Preparations for ONE store IAP #
Installation #
Add package
Run this command with flutter:
$ flutter pub add flutter_onestore_inapp
Add dependency to pubspec.yamlREADME.md
dependencies: .. flutter_onestore_inapp: ^0.2.0 ..
Click 'pub get' to download the package or run 'flutter pub get' from the command line.
Add dependencies to build.gradle
Add the maven address to the project's build.gradle
allprojects { repositories { .. maven { url 'https://repo.onestore.co.kr/repository/onestore-sdk-public' } } }
Add to AndroidManifest.xml
If the Target SDK version is 30 (OS 11) or higher, the <queries> below must be added for the in-app library to operate properly.
<manifest> ... <queries> <intent> <action android:name="com.onestore.ipc.iap.IapService.ACTION" /> </intent> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="onestore" /> </intent> </queries> ... <application> ... </application> </manifest>
Usage #
Import it and use in Dart code.
import 'package:flutter_onestore_inapp/flutter_onestore_inapp.dart';
- Request Login
- Update purchase data
- Query Product Details
- Launch Purchase Flow
- Query Purchases
- Update Subscription
- Open the subscription management
- Install ONE store service (OSS)
Proguard Rules #
It's already obfuscated and in aar, so add the package to the proguard rules.
# Core proGuard rules
-keep class com.gaa.sdk.base.** { *; }
-keep class com.gaa.sdk.auth.** { *; }
# Purchasing proGuard rules
-keep class com.gaa.sdk.iap.** { *; }
# Licensing proGuard rules
-keep class com.onestore.extern.licensing.** { *; }
Note #
This plugin uses
json_serializable for the
many data structs passed between the underlying platform layers and Dart. After
editing any of the serialized data structs, rebuild the serializers by running
flutter packages pub run build_runner build --delete-conflicting-outputs
.
flutter packages pub run build_runner watch --delete-conflicting-outputs
will
watch the filesystem for changes.