getSubscriptions method
Retrieves subscriptions on Android
and iOS
.
iOS
also returns non-subscription products.
Implementation
Future<List<IAPItem>> getSubscriptions(List<String> productIds) async {
if (_platform.isAndroid) {
dynamic result = await _channel.invokeMethod(
'getSubscriptions',
<String, dynamic>{
'productIds': productIds.toList(),
},
);
return extractItems(result);
} else if (_platform.isIOS) {
dynamic result = await _channel.invokeMethod(
'getItems',
<String, dynamic>{
'skus': productIds.toList(),
},
);
return extractItems(json.encode(result));
}
throw PlatformException(
code: _platform.operatingSystem, message: "platform not supported");
}