diff --git a/lib/purchaser_info_wrapper.dart b/lib/purchaser_info_wrapper.dart index 2fa58f2c6..1cfc795b3 100644 --- a/lib/purchaser_info_wrapper.dart +++ b/lib/purchaser_info_wrapper.dart @@ -41,6 +41,12 @@ class PurchaserInfo { /// in Android final String originalApplicationVersion; + /// URL to manage the active subscription of the user. If this user has an active iOS + /// subscription, this will point to the App Store, if the user has an active Play Store subscription + /// it will point there. If there are no active subscriptions it will be null. + /// If there are multiple for different platforms, it will point to the device store. + final String managementURL; + PurchaserInfo.fromJson(Map map) : entitlements = EntitlementInfos.fromJson( map["entitlements"] as Map), @@ -61,7 +67,8 @@ class PurchaserInfo { allPurchaseDates = (map["allPurchaseDates"] as Map) .map((key, value) => MapEntry(key as String, value as String)), originalApplicationVersion = map["originalApplicationVersion"], - originalPurchaseDate = map["originalPurchaseDate"]; + originalPurchaseDate = map["originalPurchaseDate"], + managementURL = map["managementURL"]; @override String toString() { @@ -76,6 +83,7 @@ class PurchaserInfo { 'originalAppUserId: $originalAppUserId, ' 'requestDate: $requestDate, ' 'originalApplicationVersion: $originalApplicationVersion, ' - 'originalPurchaseDate: $originalPurchaseDate}'; + 'originalPurchaseDate: $originalPurchaseDate, ' + 'managementURL: $managementURL}'; } } diff --git a/lib/purchases_flutter.dart b/lib/purchases_flutter.dart index be1c67609..d27855c8d 100644 --- a/lib/purchases_flutter.dart +++ b/lib/purchases_flutter.dart @@ -260,7 +260,7 @@ class Purchases { return await _channel .invokeMethod('setProxyURLString', {'proxyURLString': url}); } - + /// Gets current purchaser info, which will normally be cached. static Future getPurchaserInfo() async { Map result =