LinkFive - Successful Subscriptions

Initialize Flutter

Initialize Flutter

Read our Getting Started Guide to check how to add the plugin to your flutter project

Sign Up and Get your Free LinkFive Api Key

First Sign up on our Website. It's free!

Create Your Api Key

After logging in, select the API menu item and click on "Create New Api Key"

LinkFive Create a new Api Key

The api key will be generated and can be used in your project.

You can also create multiple Api Keys for your staging app or for testing your subscriptions and can be used to filter Subscriptions using the Playout

Initialize the Plugin

Use the Api key and initialize the LinkFive plugin pretty early in your code. You can use any state management systems such as Provider, getX, riverpod or bloc.

// Get your API key after sign up
LinkFivePurchases.init("API_KEY");

After calling init, the plugin will check for all active subscriptions the user already purchased and will verify the receipts using the linkfive api.

Initialize the Provider Plugin

We also developed an easy to use provider plugin linkfive_purchases_provider.

Just add the provider to your other providers and initialize using lazy:false to immediately check for active subscriptions.

MultiProvider(
providers: [
// ...
ChangeNotifierProvider(
create: (context) => LinkFiveProvider("API_KEY"),
lazy: false,
),
]
)

The Provider will now fetch all active subscriptions and can be used like any other provider using the consumer function.

Consumer<LinkFiveProvider>(
builder: (_, provider, __) {
return PaywallScaffold(
child: SimplePaywall(
callbackInterface: provider.callbackInterface,
subscriptionListData: provider.getSubscriptionListData(context),
// ...
));
},
);

Next: Get All Active Subscriptions