Skip to content

Commit

Permalink
adds management URL (RevenueCat#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro authored Jun 17, 2020
1 parent 6d9377f commit 884780a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/purchaser_info_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<dynamic, dynamic> map)
: entitlements = EntitlementInfos.fromJson(
map["entitlements"] as Map<dynamic, dynamic>),
Expand All @@ -61,7 +67,8 @@ class PurchaserInfo {
allPurchaseDates = (map["allPurchaseDates"] as Map<dynamic, dynamic>)
.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() {
Expand All @@ -76,6 +83,7 @@ class PurchaserInfo {
'originalAppUserId: $originalAppUserId, '
'requestDate: $requestDate, '
'originalApplicationVersion: $originalApplicationVersion, '
'originalPurchaseDate: $originalPurchaseDate}';
'originalPurchaseDate: $originalPurchaseDate, '
'managementURL: $managementURL}';
}
}
2 changes: 1 addition & 1 deletion lib/purchases_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class Purchases {
return await _channel
.invokeMethod('setProxyURLString', {'proxyURLString': url});
}

/// Gets current purchaser info, which will normally be cached.
static Future<PurchaserInfo> getPurchaserInfo() async {
Map<dynamic, dynamic> result =
Expand Down

0 comments on commit 884780a

Please sign in to comment.