subscription static method

Returns ApphudSubscriptionWrapper subscription object that current user has ever purchased. Subscriptions are cached on device.

If returned object is not null, it doesn't mean that subscription is active. You should check Apphud.hasActiveSubscription() method or subscription.isActive() value to determine whether or not to unlock premium functionality to the user. If you have more than one subscription group in your app, use subscriptions() method and get isActive value for your desired subscription.

Implementation

static Future<ApphudSubscriptionWrapper?> subscription() async {
  final Map<dynamic, dynamic>? json =
      await _channel.invokeMethod<Map<dynamic, dynamic>>('subscription');
  return json != null ? ApphudSubscriptionWrapper.fromJson(json) : null;
}