Skip to main content

Initialization

The first step to integrate with Appmate SDK is to add the library to your app and initialize an instance of the Appmate. With Appmate SDK, you will be able to manage all the processes of Apple's IAP APIs through the single sdk. To integrate the Appmate run this command with Flutter:

flutter pub add appmate_flutter

This will add a line like this to your package's pubspec.yaml and run an implicit flutter pub get:

dependencies:  appmate_flutter: ^0.0.1

Creating Apps#

If you haven't created your apps at App Store Connect Console yet, please start by following this guide step-by-step.

If you haven't created your apps at Google Play Console and Huawei App Gallery Console yet, please start by following this guide step-by-step.

Configuration#

If you haven't done Google Store Configuration yet, please start by following this guide.

If you haven't done App Gallery Configuration yet, please start by following this guide.

If you haven't done App Store Configuration yet, please start by following this guide.

Creating Products#

If you haven't created any products for Android, please start by following this guide.

If you haven't created any products for iOS, please start by following this guide.

Requirements#

Minimum iOS target: iOS 11.0+

Minimum Android API Level: 19+

Initialization of Appmate#

Once you've added a dependency on the Appmate SDK, you have to set ApiKey initially. And you can set UserId and SandboxActive optionally. Appmate is a singleton class that you can create it once in your app and call by Appmate instance throughout your app. We recommend you to set initial configurations in the AppDelegate class of your app or within a singleton class. Appmate is the main class for communication between the Appmate SDK and the rest of your app. You can retrieve apiKey from Appmate console.

@overridevoid initState() {  super.initState();  PurchaseClient.setApiKey("apiKey");}

Also you can retrieve userId from Appmate SDK regardless of you set a userId or a random userId is created.

String userId = PurchaseClient.getUserId();