Skip to content

Commit 3e51048

Browse files
authored
Update docs after new majors (#1000)
* Update docs after new majors * Change variable name to reflect new type
1 parent 90e3854 commit 3e51048

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
implementation 'com.revenuecat.purchases:purchases:8.17.1'
1+
implementation 'com.revenuecat.purchases:purchases:9.1.0'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
implementation 'com.revenuecat.purchases:purchases:8.17.1'
2-
implementation 'com.revenuecat.purchases:purchases-store-amazon:8.17.1'
1+
implementation 'com.revenuecat.purchases:purchases:9.1.0'
2+
implementation 'com.revenuecat.purchases:purchases-store-amazon:9.1.0'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
implementation("com.revenuecat.purchases:purchases:8.17.1")
1+
implementation("com.revenuecat.purchases:purchases:9.1.0")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
implementation("com.revenuecat.purchases:purchases:8.17.1")
2-
implementation("com.revenuecat.purchases:purchases-store-amazon:8.17.1")
1+
implementation("com.revenuecat.purchases:purchases:9.1.0")
2+
implementation("com.revenuecat.purchases:purchases-store-amazon:9.1.0")

code_blocks/getting-started/making-purchases_5.js.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Using Offerings/Packages
22
try {
3-
CustomerInfo customerInfo = await Purchases.purchasePackage(package);
4-
if (customerInfo.entitlements.all["my_entitlement_identifier"].isActive) {
3+
PurchaseResult purchaseResult = await Purchases.purchasePackage(package);
4+
if (purchaseResult.customerInfo.entitlements.all["my_entitlement_identifier"].isActive) {
55
// Unlock that great "pro" content
66
}
77
} on PlatformException catch (e) {
@@ -14,8 +14,8 @@ try {
1414
// Note: if you are not using offerings/packages to purchase In-app products, you can use purchaseStoreProduct and getProducts
1515

1616
try {
17-
CustomerInfo customerInfo = await Purchases.purchaseStoreProduct(productToBuy);
18-
if (customerInfo.entitlements.all["my_entitlement_identifier"].isActive) {
17+
PurchaseResult purchaseResult = await Purchases.purchaseStoreProduct(productToBuy);
18+
if (purchaseResult.customerInfo.entitlements.all["my_entitlement_identifier"].isActive) {
1919
// Unlock that great "pro" content
2020
}
2121
} on PlatformException catch (e) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Purchases purchases = GetComponent<Purchases>();
2-
purchases.PurchasePackage(package, (productIdentifier, customerInfo, userCancelled, error) =>
2+
purchases.PurchasePackage(package, (purchaseResult) =>
33
{
4-
if (customerInfo.Entitlements.Active.ContainsKey("my_entitlement_identifier")) {
4+
if (purchaseResult.CustomerInfo.Entitlements.Active.ContainsKey("my_entitlement_identifier")) {
55
// Unlock that great "pro" content
66
}
77
});

code_blocks/subscription-guidance/subscription-offers/ios-winback-offers-purchase-winback-offer-flutter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try {
2-
final customerInfo = await Purchases.purchasePackageWithWinBackOffer(package, selectedWinBackOffer);
2+
final purchaseResult = await Purchases.purchasePackageWithWinBackOffer(package, selectedWinBackOffer);
33
// TODO: Handle successful purchase in your UI
44
} catch (e) {
55
print('Win-Back offer purchase failed: $e');
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
debugImplementation "com.revenuecat.purchases:purchases-debug-view:6.9.2"
2-
releaseImplementation "com.revenuecat.purchases:purchases-debug-view-noop:6.9.2"
1+
debugImplementation "com.revenuecat.purchases:purchases-debug-view:9.1.0"
2+
releaseImplementation "com.revenuecat.purchases:purchases-debug-view-noop:9.1.0"

code_blocks/web/web-billing/redemption_flutter.dart

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ String redemptionUrl = 'YOUR_REDEMPTION_URL';
33
final webPurchaseRedemption = await Purchases.parseAsWebPurchaseRedemption(redemptionUrl);
44

55
if (webPurchaseRedemption != null) {
6-
final result = await Purchases.redeemWebPurchase(webPurchaseRedemption);
7-
result.when(
8-
success: (customerInfo) {
9-
// Redemption was successful and entitlements were granted to the user.
10-
},
11-
error: (error) {
12-
// Redemption failed due to an error.
13-
},
14-
purchaseBelongsToOtherUser: () {
15-
// The purchase associated to the link belongs to a different user and it cannot be redeemed.
16-
},
17-
invalidToken: () {
18-
// The redemption link is invalid.
19-
},
20-
expired: (obfuscatedEmail) {
21-
// The redemption link has expired. A new one has been sent to the user to the provided obfuscated email.
22-
}
23-
);
6+
final result = await Purchases.redeemWebPurchase(webPurchaseRedemption);
7+
switch (result) {
8+
case WebPurchaseRedemptionSuccess(:final customerInfo):
9+
// Redemption was successful and entitlements were granted to the user.
10+
break;
11+
case WebPurchaseRedemptionError(:final error):
12+
// Redemption failed due to an error.
13+
break;
14+
case WebPurchaseRedemptionPurchaseBelongsToOtherUser():
15+
// The purchase associated to the link belongs to a different user and it cannot be redeemed.
16+
break;
17+
case WebPurchaseRedemptionInvalidToken():
18+
// The redemption link is invalid.
19+
break;
20+
case WebPurchaseRedemptionExpired(:final obfuscatedEmail):
21+
// The redemption link has expired. A new one has been sent to the user to the provided obfuscated email.
22+
break;
23+
};
2424
}

0 commit comments

Comments
 (0)