product static method
Returns ApphudProductComposite object by productIdentifier
.
Note that you have to add this product identifier in Apphud Dashboard > Product Hub > Products.
Will return null
if product is not yet fetched from the App Store.
Best practise is not to use this method, but implement paywalls logic by adding your
paywall configuration in Apphud Dashboard > Product Hub > Paywalls.
Implementation
static Future<ApphudProductComposite?> product(
String productIdentifier) async {
final Map<dynamic, dynamic>? json =
await _channel.invokeMethod<Map<dynamic, dynamic>>(
'product',
{'productIdentifier': productIdentifier},
);
return json != null ? ApphudProductComposite.fromJson(json) : null;
}