diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
index 4b7329ca448..b1115c133fa 100644
--- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
+++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.3.3
+
+* Converts data objects in internal platform communication to Pigeon.
+* Deprecates JSON serialization and deserialization for Billing Client wrapper
+ objects.
+
## 0.3.2+1
* Converts internal platform communication to Pigeon.
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java
index 09701660aa9..6a465b4bb2c 100644
--- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java
+++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java
@@ -103,12 +103,38 @@ private PlatformBillingChoiceMode(final int index) {
}
}
+ /** Pigeon version of Java Purchase.PurchaseState. */
+ public enum PlatformPurchaseState {
+ UNSPECIFIED(0),
+ PURCHASED(1),
+ PENDING(2);
+
+ final int index;
+
+ private PlatformPurchaseState(final int index) {
+ this.index = index;
+ }
+ }
+
+ /** Pigeon version of Java ProductDetails.RecurrenceMode. */
+ public enum PlatformRecurrenceMode {
+ FINITE_RECURRING(0),
+ INFINITE_RECURRING(1),
+ NON_RECURRING(2);
+
+ final int index;
+
+ private PlatformRecurrenceMode(final int index) {
+ this.index = index;
+ }
+ }
+
/**
- * Pigeon version of Java Product.
+ * Pigeon version of Java QueryProductDetailsParams.Product.
*
*
Generated class from Pigeon that represents data sent in messages.
*/
- public static final class PlatformProduct {
+ public static final class PlatformQueryProduct {
private @NonNull String productId;
public @NonNull String getProductId() {
@@ -136,7 +162,7 @@ public void setProductType(@NonNull PlatformProductType setterArg) {
}
/** Constructor is non-public to enforce null safety; use Builder. */
- PlatformProduct() {}
+ PlatformQueryProduct() {}
public static final class Builder {
@@ -156,8 +182,8 @@ public static final class Builder {
return this;
}
- public @NonNull PlatformProduct build() {
- PlatformProduct pigeonReturn = new PlatformProduct();
+ public @NonNull PlatformQueryProduct build() {
+ PlatformQueryProduct pigeonReturn = new PlatformQueryProduct();
pigeonReturn.setProductId(productId);
pigeonReturn.setProductType(productType);
return pigeonReturn;
@@ -172,8 +198,8 @@ ArrayList toList() {
return toListResult;
}
- static @NonNull PlatformProduct fromList(@NonNull ArrayList list) {
- PlatformProduct pigeonResult = new PlatformProduct();
+ static @NonNull PlatformQueryProduct fromList(@NonNull ArrayList list) {
+ PlatformQueryProduct pigeonResult = new PlatformQueryProduct();
Object productId = list.get(0);
pigeonResult.setProductId((String) productId);
Object productType = list.get(1);
@@ -182,6 +208,76 @@ ArrayList toList() {
}
}
+ /**
+ * Pigeon version of Java AccountIdentifiers.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformAccountIdentifiers {
+ private @Nullable String obfuscatedAccountId;
+
+ public @Nullable String getObfuscatedAccountId() {
+ return obfuscatedAccountId;
+ }
+
+ public void setObfuscatedAccountId(@Nullable String setterArg) {
+ this.obfuscatedAccountId = setterArg;
+ }
+
+ private @Nullable String obfuscatedProfileId;
+
+ public @Nullable String getObfuscatedProfileId() {
+ return obfuscatedProfileId;
+ }
+
+ public void setObfuscatedProfileId(@Nullable String setterArg) {
+ this.obfuscatedProfileId = setterArg;
+ }
+
+ public static final class Builder {
+
+ private @Nullable String obfuscatedAccountId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setObfuscatedAccountId(@Nullable String setterArg) {
+ this.obfuscatedAccountId = setterArg;
+ return this;
+ }
+
+ private @Nullable String obfuscatedProfileId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setObfuscatedProfileId(@Nullable String setterArg) {
+ this.obfuscatedProfileId = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformAccountIdentifiers build() {
+ PlatformAccountIdentifiers pigeonReturn = new PlatformAccountIdentifiers();
+ pigeonReturn.setObfuscatedAccountId(obfuscatedAccountId);
+ pigeonReturn.setObfuscatedProfileId(obfuscatedProfileId);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(2);
+ toListResult.add(obfuscatedAccountId);
+ toListResult.add(obfuscatedProfileId);
+ return toListResult;
+ }
+
+ static @NonNull PlatformAccountIdentifiers fromList(@NonNull ArrayList list) {
+ PlatformAccountIdentifiers pigeonResult = new PlatformAccountIdentifiers();
+ Object obfuscatedAccountId = list.get(0);
+ pigeonResult.setObfuscatedAccountId((String) obfuscatedAccountId);
+ Object obfuscatedProfileId = list.get(1);
+ pigeonResult.setObfuscatedProfileId((String) obfuscatedProfileId);
+ return pigeonResult;
+ }
+ }
+
/**
* Pigeon version of Java BillingResult.
*
@@ -264,6 +360,324 @@ ArrayList toList() {
}
}
+ /**
+ * Pigeon version of Java ProductDetails.OneTimePurchaseOfferDetails.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformOneTimePurchaseOfferDetails {
+ private @NonNull Long priceAmountMicros;
+
+ public @NonNull Long getPriceAmountMicros() {
+ return priceAmountMicros;
+ }
+
+ public void setPriceAmountMicros(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"priceAmountMicros\" is null.");
+ }
+ this.priceAmountMicros = setterArg;
+ }
+
+ private @NonNull String formattedPrice;
+
+ public @NonNull String getFormattedPrice() {
+ return formattedPrice;
+ }
+
+ public void setFormattedPrice(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"formattedPrice\" is null.");
+ }
+ this.formattedPrice = setterArg;
+ }
+
+ private @NonNull String priceCurrencyCode;
+
+ public @NonNull String getPriceCurrencyCode() {
+ return priceCurrencyCode;
+ }
+
+ public void setPriceCurrencyCode(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"priceCurrencyCode\" is null.");
+ }
+ this.priceCurrencyCode = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformOneTimePurchaseOfferDetails() {}
+
+ public static final class Builder {
+
+ private @Nullable Long priceAmountMicros;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPriceAmountMicros(@NonNull Long setterArg) {
+ this.priceAmountMicros = setterArg;
+ return this;
+ }
+
+ private @Nullable String formattedPrice;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setFormattedPrice(@NonNull String setterArg) {
+ this.formattedPrice = setterArg;
+ return this;
+ }
+
+ private @Nullable String priceCurrencyCode;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPriceCurrencyCode(@NonNull String setterArg) {
+ this.priceCurrencyCode = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformOneTimePurchaseOfferDetails build() {
+ PlatformOneTimePurchaseOfferDetails pigeonReturn =
+ new PlatformOneTimePurchaseOfferDetails();
+ pigeonReturn.setPriceAmountMicros(priceAmountMicros);
+ pigeonReturn.setFormattedPrice(formattedPrice);
+ pigeonReturn.setPriceCurrencyCode(priceCurrencyCode);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(3);
+ toListResult.add(priceAmountMicros);
+ toListResult.add(formattedPrice);
+ toListResult.add(priceCurrencyCode);
+ return toListResult;
+ }
+
+ static @NonNull PlatformOneTimePurchaseOfferDetails fromList(@NonNull ArrayList list) {
+ PlatformOneTimePurchaseOfferDetails pigeonResult = new PlatformOneTimePurchaseOfferDetails();
+ Object priceAmountMicros = list.get(0);
+ pigeonResult.setPriceAmountMicros(
+ (priceAmountMicros == null)
+ ? null
+ : ((priceAmountMicros instanceof Integer)
+ ? (Integer) priceAmountMicros
+ : (Long) priceAmountMicros));
+ Object formattedPrice = list.get(1);
+ pigeonResult.setFormattedPrice((String) formattedPrice);
+ Object priceCurrencyCode = list.get(2);
+ pigeonResult.setPriceCurrencyCode((String) priceCurrencyCode);
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of Java ProductDetails.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformProductDetails {
+ private @NonNull String description;
+
+ public @NonNull String getDescription() {
+ return description;
+ }
+
+ public void setDescription(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"description\" is null.");
+ }
+ this.description = setterArg;
+ }
+
+ private @NonNull String name;
+
+ public @NonNull String getName() {
+ return name;
+ }
+
+ public void setName(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"name\" is null.");
+ }
+ this.name = setterArg;
+ }
+
+ private @NonNull String productId;
+
+ public @NonNull String getProductId() {
+ return productId;
+ }
+
+ public void setProductId(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"productId\" is null.");
+ }
+ this.productId = setterArg;
+ }
+
+ private @NonNull PlatformProductType productType;
+
+ public @NonNull PlatformProductType getProductType() {
+ return productType;
+ }
+
+ public void setProductType(@NonNull PlatformProductType setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"productType\" is null.");
+ }
+ this.productType = setterArg;
+ }
+
+ private @NonNull String title;
+
+ public @NonNull String getTitle() {
+ return title;
+ }
+
+ public void setTitle(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"title\" is null.");
+ }
+ this.title = setterArg;
+ }
+
+ private @Nullable PlatformOneTimePurchaseOfferDetails oneTimePurchaseOfferDetails;
+
+ public @Nullable PlatformOneTimePurchaseOfferDetails getOneTimePurchaseOfferDetails() {
+ return oneTimePurchaseOfferDetails;
+ }
+
+ public void setOneTimePurchaseOfferDetails(
+ @Nullable PlatformOneTimePurchaseOfferDetails setterArg) {
+ this.oneTimePurchaseOfferDetails = setterArg;
+ }
+
+ private @Nullable List subscriptionOfferDetails;
+
+ public @Nullable List getSubscriptionOfferDetails() {
+ return subscriptionOfferDetails;
+ }
+
+ public void setSubscriptionOfferDetails(
+ @Nullable List setterArg) {
+ this.subscriptionOfferDetails = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformProductDetails() {}
+
+ public static final class Builder {
+
+ private @Nullable String description;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setDescription(@NonNull String setterArg) {
+ this.description = setterArg;
+ return this;
+ }
+
+ private @Nullable String name;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setName(@NonNull String setterArg) {
+ this.name = setterArg;
+ return this;
+ }
+
+ private @Nullable String productId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setProductId(@NonNull String setterArg) {
+ this.productId = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformProductType productType;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setProductType(@NonNull PlatformProductType setterArg) {
+ this.productType = setterArg;
+ return this;
+ }
+
+ private @Nullable String title;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setTitle(@NonNull String setterArg) {
+ this.title = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformOneTimePurchaseOfferDetails oneTimePurchaseOfferDetails;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOneTimePurchaseOfferDetails(
+ @Nullable PlatformOneTimePurchaseOfferDetails setterArg) {
+ this.oneTimePurchaseOfferDetails = setterArg;
+ return this;
+ }
+
+ private @Nullable List subscriptionOfferDetails;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setSubscriptionOfferDetails(
+ @Nullable List setterArg) {
+ this.subscriptionOfferDetails = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformProductDetails build() {
+ PlatformProductDetails pigeonReturn = new PlatformProductDetails();
+ pigeonReturn.setDescription(description);
+ pigeonReturn.setName(name);
+ pigeonReturn.setProductId(productId);
+ pigeonReturn.setProductType(productType);
+ pigeonReturn.setTitle(title);
+ pigeonReturn.setOneTimePurchaseOfferDetails(oneTimePurchaseOfferDetails);
+ pigeonReturn.setSubscriptionOfferDetails(subscriptionOfferDetails);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(7);
+ toListResult.add(description);
+ toListResult.add(name);
+ toListResult.add(productId);
+ toListResult.add(productType == null ? null : productType.index);
+ toListResult.add(title);
+ toListResult.add(
+ (oneTimePurchaseOfferDetails == null) ? null : oneTimePurchaseOfferDetails.toList());
+ toListResult.add(subscriptionOfferDetails);
+ return toListResult;
+ }
+
+ static @NonNull PlatformProductDetails fromList(@NonNull ArrayList list) {
+ PlatformProductDetails pigeonResult = new PlatformProductDetails();
+ Object description = list.get(0);
+ pigeonResult.setDescription((String) description);
+ Object name = list.get(1);
+ pigeonResult.setName((String) name);
+ Object productId = list.get(2);
+ pigeonResult.setProductId((String) productId);
+ Object productType = list.get(3);
+ pigeonResult.setProductType(PlatformProductType.values()[(int) productType]);
+ Object title = list.get(4);
+ pigeonResult.setTitle((String) title);
+ Object oneTimePurchaseOfferDetails = list.get(5);
+ pigeonResult.setOneTimePurchaseOfferDetails(
+ (oneTimePurchaseOfferDetails == null)
+ ? null
+ : PlatformOneTimePurchaseOfferDetails.fromList(
+ (ArrayList) oneTimePurchaseOfferDetails));
+ Object subscriptionOfferDetails = list.get(6);
+ pigeonResult.setSubscriptionOfferDetails(
+ (List) subscriptionOfferDetails);
+ return pigeonResult;
+ }
+ }
+
/**
* Pigeon version of ProductDetailsResponseWrapper, which contains the components of the Java
* ProductDetailsResponseListener callback.
@@ -284,21 +698,17 @@ public void setBillingResult(@NonNull PlatformBillingResult setterArg) {
this.billingResult = setterArg;
}
- /**
- * A JSON-compatible list of details, where each entry in the list is a Map
- * JSON encoding of the product details.
- */
- private @NonNull List productDetailsJsonList;
+ private @NonNull List productDetails;
- public @NonNull List getProductDetailsJsonList() {
- return productDetailsJsonList;
+ public @NonNull List getProductDetails() {
+ return productDetails;
}
- public void setProductDetailsJsonList(@NonNull List setterArg) {
+ public void setProductDetails(@NonNull List setterArg) {
if (setterArg == null) {
- throw new IllegalStateException("Nonnull field \"productDetailsJsonList\" is null.");
+ throw new IllegalStateException("Nonnull field \"productDetails\" is null.");
}
- this.productDetailsJsonList = setterArg;
+ this.productDetails = setterArg;
}
/** Constructor is non-public to enforce null safety; use Builder. */
@@ -314,18 +724,18 @@ public static final class Builder {
return this;
}
- private @Nullable List productDetailsJsonList;
+ private @Nullable List productDetails;
@CanIgnoreReturnValue
- public @NonNull Builder setProductDetailsJsonList(@NonNull List setterArg) {
- this.productDetailsJsonList = setterArg;
+ public @NonNull Builder setProductDetails(@NonNull List setterArg) {
+ this.productDetails = setterArg;
return this;
}
public @NonNull PlatformProductDetailsResponse build() {
PlatformProductDetailsResponse pigeonReturn = new PlatformProductDetailsResponse();
pigeonReturn.setBillingResult(billingResult);
- pigeonReturn.setProductDetailsJsonList(productDetailsJsonList);
+ pigeonReturn.setProductDetails(productDetails);
return pigeonReturn;
}
}
@@ -334,7 +744,7 @@ public static final class Builder {
ArrayList toList() {
ArrayList toListResult = new ArrayList(2);
toListResult.add((billingResult == null) ? null : billingResult.toList());
- toListResult.add(productDetailsJsonList);
+ toListResult.add(productDetails);
return toListResult;
}
@@ -345,8 +755,8 @@ ArrayList toList() {
(billingResult == null)
? null
: PlatformBillingResult.fromList((ArrayList) billingResult));
- Object productDetailsJsonList = list.get(1);
- pigeonResult.setProductDetailsJsonList((List) productDetailsJsonList);
+ Object productDetails = list.get(1);
+ pigeonResult.setProductDetails((List) productDetails);
return pigeonResult;
}
}
@@ -615,63 +1025,820 @@ public static final class Builder {
return this;
}
- private @Nullable Long prorationMode;
+ private @Nullable Long prorationMode;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setProrationMode(@NonNull Long setterArg) {
+ this.prorationMode = setterArg;
+ return this;
+ }
+
+ private @Nullable String offerToken;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOfferToken(@Nullable String setterArg) {
+ this.offerToken = setterArg;
+ return this;
+ }
+
+ private @Nullable String accountId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setAccountId(@Nullable String setterArg) {
+ this.accountId = setterArg;
+ return this;
+ }
+
+ private @Nullable String obfuscatedProfileId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setObfuscatedProfileId(@Nullable String setterArg) {
+ this.obfuscatedProfileId = setterArg;
+ return this;
+ }
+
+ private @Nullable String oldProduct;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOldProduct(@Nullable String setterArg) {
+ this.oldProduct = setterArg;
+ return this;
+ }
+
+ private @Nullable String purchaseToken;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPurchaseToken(@Nullable String setterArg) {
+ this.purchaseToken = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformBillingFlowParams build() {
+ PlatformBillingFlowParams pigeonReturn = new PlatformBillingFlowParams();
+ pigeonReturn.setProduct(product);
+ pigeonReturn.setProrationMode(prorationMode);
+ pigeonReturn.setOfferToken(offerToken);
+ pigeonReturn.setAccountId(accountId);
+ pigeonReturn.setObfuscatedProfileId(obfuscatedProfileId);
+ pigeonReturn.setOldProduct(oldProduct);
+ pigeonReturn.setPurchaseToken(purchaseToken);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(7);
+ toListResult.add(product);
+ toListResult.add(prorationMode);
+ toListResult.add(offerToken);
+ toListResult.add(accountId);
+ toListResult.add(obfuscatedProfileId);
+ toListResult.add(oldProduct);
+ toListResult.add(purchaseToken);
+ return toListResult;
+ }
+
+ static @NonNull PlatformBillingFlowParams fromList(@NonNull ArrayList list) {
+ PlatformBillingFlowParams pigeonResult = new PlatformBillingFlowParams();
+ Object product = list.get(0);
+ pigeonResult.setProduct((String) product);
+ Object prorationMode = list.get(1);
+ pigeonResult.setProrationMode(
+ (prorationMode == null)
+ ? null
+ : ((prorationMode instanceof Integer)
+ ? (Integer) prorationMode
+ : (Long) prorationMode));
+ Object offerToken = list.get(2);
+ pigeonResult.setOfferToken((String) offerToken);
+ Object accountId = list.get(3);
+ pigeonResult.setAccountId((String) accountId);
+ Object obfuscatedProfileId = list.get(4);
+ pigeonResult.setObfuscatedProfileId((String) obfuscatedProfileId);
+ Object oldProduct = list.get(5);
+ pigeonResult.setOldProduct((String) oldProduct);
+ Object purchaseToken = list.get(6);
+ pigeonResult.setPurchaseToken((String) purchaseToken);
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of Java ProductDetails.PricingPhase.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformPricingPhase {
+ private @NonNull Long billingCycleCount;
+
+ public @NonNull Long getBillingCycleCount() {
+ return billingCycleCount;
+ }
+
+ public void setBillingCycleCount(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"billingCycleCount\" is null.");
+ }
+ this.billingCycleCount = setterArg;
+ }
+
+ private @NonNull PlatformRecurrenceMode recurrenceMode;
+
+ public @NonNull PlatformRecurrenceMode getRecurrenceMode() {
+ return recurrenceMode;
+ }
+
+ public void setRecurrenceMode(@NonNull PlatformRecurrenceMode setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"recurrenceMode\" is null.");
+ }
+ this.recurrenceMode = setterArg;
+ }
+
+ private @NonNull Long priceAmountMicros;
+
+ public @NonNull Long getPriceAmountMicros() {
+ return priceAmountMicros;
+ }
+
+ public void setPriceAmountMicros(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"priceAmountMicros\" is null.");
+ }
+ this.priceAmountMicros = setterArg;
+ }
+
+ private @NonNull String billingPeriod;
+
+ public @NonNull String getBillingPeriod() {
+ return billingPeriod;
+ }
+
+ public void setBillingPeriod(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"billingPeriod\" is null.");
+ }
+ this.billingPeriod = setterArg;
+ }
+
+ private @NonNull String formattedPrice;
+
+ public @NonNull String getFormattedPrice() {
+ return formattedPrice;
+ }
+
+ public void setFormattedPrice(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"formattedPrice\" is null.");
+ }
+ this.formattedPrice = setterArg;
+ }
+
+ private @NonNull String priceCurrencyCode;
+
+ public @NonNull String getPriceCurrencyCode() {
+ return priceCurrencyCode;
+ }
+
+ public void setPriceCurrencyCode(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"priceCurrencyCode\" is null.");
+ }
+ this.priceCurrencyCode = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformPricingPhase() {}
+
+ public static final class Builder {
+
+ private @Nullable Long billingCycleCount;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setBillingCycleCount(@NonNull Long setterArg) {
+ this.billingCycleCount = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformRecurrenceMode recurrenceMode;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setRecurrenceMode(@NonNull PlatformRecurrenceMode setterArg) {
+ this.recurrenceMode = setterArg;
+ return this;
+ }
+
+ private @Nullable Long priceAmountMicros;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPriceAmountMicros(@NonNull Long setterArg) {
+ this.priceAmountMicros = setterArg;
+ return this;
+ }
+
+ private @Nullable String billingPeriod;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setBillingPeriod(@NonNull String setterArg) {
+ this.billingPeriod = setterArg;
+ return this;
+ }
+
+ private @Nullable String formattedPrice;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setFormattedPrice(@NonNull String setterArg) {
+ this.formattedPrice = setterArg;
+ return this;
+ }
+
+ private @Nullable String priceCurrencyCode;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPriceCurrencyCode(@NonNull String setterArg) {
+ this.priceCurrencyCode = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformPricingPhase build() {
+ PlatformPricingPhase pigeonReturn = new PlatformPricingPhase();
+ pigeonReturn.setBillingCycleCount(billingCycleCount);
+ pigeonReturn.setRecurrenceMode(recurrenceMode);
+ pigeonReturn.setPriceAmountMicros(priceAmountMicros);
+ pigeonReturn.setBillingPeriod(billingPeriod);
+ pigeonReturn.setFormattedPrice(formattedPrice);
+ pigeonReturn.setPriceCurrencyCode(priceCurrencyCode);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(6);
+ toListResult.add(billingCycleCount);
+ toListResult.add(recurrenceMode == null ? null : recurrenceMode.index);
+ toListResult.add(priceAmountMicros);
+ toListResult.add(billingPeriod);
+ toListResult.add(formattedPrice);
+ toListResult.add(priceCurrencyCode);
+ return toListResult;
+ }
+
+ static @NonNull PlatformPricingPhase fromList(@NonNull ArrayList list) {
+ PlatformPricingPhase pigeonResult = new PlatformPricingPhase();
+ Object billingCycleCount = list.get(0);
+ pigeonResult.setBillingCycleCount(
+ (billingCycleCount == null)
+ ? null
+ : ((billingCycleCount instanceof Integer)
+ ? (Integer) billingCycleCount
+ : (Long) billingCycleCount));
+ Object recurrenceMode = list.get(1);
+ pigeonResult.setRecurrenceMode(PlatformRecurrenceMode.values()[(int) recurrenceMode]);
+ Object priceAmountMicros = list.get(2);
+ pigeonResult.setPriceAmountMicros(
+ (priceAmountMicros == null)
+ ? null
+ : ((priceAmountMicros instanceof Integer)
+ ? (Integer) priceAmountMicros
+ : (Long) priceAmountMicros));
+ Object billingPeriod = list.get(3);
+ pigeonResult.setBillingPeriod((String) billingPeriod);
+ Object formattedPrice = list.get(4);
+ pigeonResult.setFormattedPrice((String) formattedPrice);
+ Object priceCurrencyCode = list.get(5);
+ pigeonResult.setPriceCurrencyCode((String) priceCurrencyCode);
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of Java Purchase.
+ *
+ * See also PurchaseWrapper on the Dart side.
+ *
+ *
Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformPurchase {
+ private @Nullable String orderId;
+
+ public @Nullable String getOrderId() {
+ return orderId;
+ }
+
+ public void setOrderId(@Nullable String setterArg) {
+ this.orderId = setterArg;
+ }
+
+ private @NonNull String packageName;
+
+ public @NonNull String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"packageName\" is null.");
+ }
+ this.packageName = setterArg;
+ }
+
+ private @NonNull Long purchaseTime;
+
+ public @NonNull Long getPurchaseTime() {
+ return purchaseTime;
+ }
+
+ public void setPurchaseTime(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"purchaseTime\" is null.");
+ }
+ this.purchaseTime = setterArg;
+ }
+
+ private @NonNull String purchaseToken;
+
+ public @NonNull String getPurchaseToken() {
+ return purchaseToken;
+ }
+
+ public void setPurchaseToken(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"purchaseToken\" is null.");
+ }
+ this.purchaseToken = setterArg;
+ }
+
+ private @NonNull String signature;
+
+ public @NonNull String getSignature() {
+ return signature;
+ }
+
+ public void setSignature(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"signature\" is null.");
+ }
+ this.signature = setterArg;
+ }
+
+ private @NonNull List products;
+
+ public @NonNull List getProducts() {
+ return products;
+ }
+
+ public void setProducts(@NonNull List setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"products\" is null.");
+ }
+ this.products = setterArg;
+ }
+
+ private @NonNull Boolean isAutoRenewing;
+
+ public @NonNull Boolean getIsAutoRenewing() {
+ return isAutoRenewing;
+ }
+
+ public void setIsAutoRenewing(@NonNull Boolean setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"isAutoRenewing\" is null.");
+ }
+ this.isAutoRenewing = setterArg;
+ }
+
+ private @NonNull String originalJson;
+
+ public @NonNull String getOriginalJson() {
+ return originalJson;
+ }
+
+ public void setOriginalJson(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"originalJson\" is null.");
+ }
+ this.originalJson = setterArg;
+ }
+
+ private @NonNull String developerPayload;
+
+ public @NonNull String getDeveloperPayload() {
+ return developerPayload;
+ }
+
+ public void setDeveloperPayload(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"developerPayload\" is null.");
+ }
+ this.developerPayload = setterArg;
+ }
+
+ private @NonNull Boolean isAcknowledged;
+
+ public @NonNull Boolean getIsAcknowledged() {
+ return isAcknowledged;
+ }
+
+ public void setIsAcknowledged(@NonNull Boolean setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"isAcknowledged\" is null.");
+ }
+ this.isAcknowledged = setterArg;
+ }
+
+ private @NonNull Long quantity;
+
+ public @NonNull Long getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"quantity\" is null.");
+ }
+ this.quantity = setterArg;
+ }
+
+ private @NonNull PlatformPurchaseState purchaseState;
+
+ public @NonNull PlatformPurchaseState getPurchaseState() {
+ return purchaseState;
+ }
+
+ public void setPurchaseState(@NonNull PlatformPurchaseState setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"purchaseState\" is null.");
+ }
+ this.purchaseState = setterArg;
+ }
+
+ private @Nullable PlatformAccountIdentifiers accountIdentifiers;
+
+ public @Nullable PlatformAccountIdentifiers getAccountIdentifiers() {
+ return accountIdentifiers;
+ }
+
+ public void setAccountIdentifiers(@Nullable PlatformAccountIdentifiers setterArg) {
+ this.accountIdentifiers = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformPurchase() {}
+
+ public static final class Builder {
+
+ private @Nullable String orderId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOrderId(@Nullable String setterArg) {
+ this.orderId = setterArg;
+ return this;
+ }
+
+ private @Nullable String packageName;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPackageName(@NonNull String setterArg) {
+ this.packageName = setterArg;
+ return this;
+ }
+
+ private @Nullable Long purchaseTime;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPurchaseTime(@NonNull Long setterArg) {
+ this.purchaseTime = setterArg;
+ return this;
+ }
+
+ private @Nullable String purchaseToken;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPurchaseToken(@NonNull String setterArg) {
+ this.purchaseToken = setterArg;
+ return this;
+ }
+
+ private @Nullable String signature;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setSignature(@NonNull String setterArg) {
+ this.signature = setterArg;
+ return this;
+ }
+
+ private @Nullable List products;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setProducts(@NonNull List setterArg) {
+ this.products = setterArg;
+ return this;
+ }
+
+ private @Nullable Boolean isAutoRenewing;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setIsAutoRenewing(@NonNull Boolean setterArg) {
+ this.isAutoRenewing = setterArg;
+ return this;
+ }
+
+ private @Nullable String originalJson;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOriginalJson(@NonNull String setterArg) {
+ this.originalJson = setterArg;
+ return this;
+ }
+
+ private @Nullable String developerPayload;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setDeveloperPayload(@NonNull String setterArg) {
+ this.developerPayload = setterArg;
+ return this;
+ }
+
+ private @Nullable Boolean isAcknowledged;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setIsAcknowledged(@NonNull Boolean setterArg) {
+ this.isAcknowledged = setterArg;
+ return this;
+ }
+
+ private @Nullable Long quantity;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setQuantity(@NonNull Long setterArg) {
+ this.quantity = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformPurchaseState purchaseState;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPurchaseState(@NonNull PlatformPurchaseState setterArg) {
+ this.purchaseState = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformAccountIdentifiers accountIdentifiers;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setAccountIdentifiers(
+ @Nullable PlatformAccountIdentifiers setterArg) {
+ this.accountIdentifiers = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformPurchase build() {
+ PlatformPurchase pigeonReturn = new PlatformPurchase();
+ pigeonReturn.setOrderId(orderId);
+ pigeonReturn.setPackageName(packageName);
+ pigeonReturn.setPurchaseTime(purchaseTime);
+ pigeonReturn.setPurchaseToken(purchaseToken);
+ pigeonReturn.setSignature(signature);
+ pigeonReturn.setProducts(products);
+ pigeonReturn.setIsAutoRenewing(isAutoRenewing);
+ pigeonReturn.setOriginalJson(originalJson);
+ pigeonReturn.setDeveloperPayload(developerPayload);
+ pigeonReturn.setIsAcknowledged(isAcknowledged);
+ pigeonReturn.setQuantity(quantity);
+ pigeonReturn.setPurchaseState(purchaseState);
+ pigeonReturn.setAccountIdentifiers(accountIdentifiers);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(13);
+ toListResult.add(orderId);
+ toListResult.add(packageName);
+ toListResult.add(purchaseTime);
+ toListResult.add(purchaseToken);
+ toListResult.add(signature);
+ toListResult.add(products);
+ toListResult.add(isAutoRenewing);
+ toListResult.add(originalJson);
+ toListResult.add(developerPayload);
+ toListResult.add(isAcknowledged);
+ toListResult.add(quantity);
+ toListResult.add(purchaseState == null ? null : purchaseState.index);
+ toListResult.add((accountIdentifiers == null) ? null : accountIdentifiers.toList());
+ return toListResult;
+ }
+
+ static @NonNull PlatformPurchase fromList(@NonNull ArrayList list) {
+ PlatformPurchase pigeonResult = new PlatformPurchase();
+ Object orderId = list.get(0);
+ pigeonResult.setOrderId((String) orderId);
+ Object packageName = list.get(1);
+ pigeonResult.setPackageName((String) packageName);
+ Object purchaseTime = list.get(2);
+ pigeonResult.setPurchaseTime(
+ (purchaseTime == null)
+ ? null
+ : ((purchaseTime instanceof Integer) ? (Integer) purchaseTime : (Long) purchaseTime));
+ Object purchaseToken = list.get(3);
+ pigeonResult.setPurchaseToken((String) purchaseToken);
+ Object signature = list.get(4);
+ pigeonResult.setSignature((String) signature);
+ Object products = list.get(5);
+ pigeonResult.setProducts((List) products);
+ Object isAutoRenewing = list.get(6);
+ pigeonResult.setIsAutoRenewing((Boolean) isAutoRenewing);
+ Object originalJson = list.get(7);
+ pigeonResult.setOriginalJson((String) originalJson);
+ Object developerPayload = list.get(8);
+ pigeonResult.setDeveloperPayload((String) developerPayload);
+ Object isAcknowledged = list.get(9);
+ pigeonResult.setIsAcknowledged((Boolean) isAcknowledged);
+ Object quantity = list.get(10);
+ pigeonResult.setQuantity(
+ (quantity == null)
+ ? null
+ : ((quantity instanceof Integer) ? (Integer) quantity : (Long) quantity));
+ Object purchaseState = list.get(11);
+ pigeonResult.setPurchaseState(PlatformPurchaseState.values()[(int) purchaseState]);
+ Object accountIdentifiers = list.get(12);
+ pigeonResult.setAccountIdentifiers(
+ (accountIdentifiers == null)
+ ? null
+ : PlatformAccountIdentifiers.fromList((ArrayList) accountIdentifiers));
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of PurchaseHistoryRecord.
+ *
+ * See also PurchaseHistoryRecordWrapper on the Dart side.
+ *
+ *
Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformPurchaseHistoryRecord {
+ private @NonNull Long quantity;
+
+ public @NonNull Long getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"quantity\" is null.");
+ }
+ this.quantity = setterArg;
+ }
+
+ private @NonNull Long purchaseTime;
+
+ public @NonNull Long getPurchaseTime() {
+ return purchaseTime;
+ }
+
+ public void setPurchaseTime(@NonNull Long setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"purchaseTime\" is null.");
+ }
+ this.purchaseTime = setterArg;
+ }
+
+ private @Nullable String developerPayload;
+
+ public @Nullable String getDeveloperPayload() {
+ return developerPayload;
+ }
+
+ public void setDeveloperPayload(@Nullable String setterArg) {
+ this.developerPayload = setterArg;
+ }
+
+ private @NonNull String originalJson;
+
+ public @NonNull String getOriginalJson() {
+ return originalJson;
+ }
+
+ public void setOriginalJson(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"originalJson\" is null.");
+ }
+ this.originalJson = setterArg;
+ }
+
+ private @NonNull String purchaseToken;
+
+ public @NonNull String getPurchaseToken() {
+ return purchaseToken;
+ }
+
+ public void setPurchaseToken(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"purchaseToken\" is null.");
+ }
+ this.purchaseToken = setterArg;
+ }
+
+ private @NonNull String signature;
+
+ public @NonNull String getSignature() {
+ return signature;
+ }
+
+ public void setSignature(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"signature\" is null.");
+ }
+ this.signature = setterArg;
+ }
+
+ private @NonNull List products;
+
+ public @NonNull List getProducts() {
+ return products;
+ }
+
+ public void setProducts(@NonNull List setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"products\" is null.");
+ }
+ this.products = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformPurchaseHistoryRecord() {}
+
+ public static final class Builder {
+
+ private @Nullable Long quantity;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setQuantity(@NonNull Long setterArg) {
+ this.quantity = setterArg;
+ return this;
+ }
+
+ private @Nullable Long purchaseTime;
@CanIgnoreReturnValue
- public @NonNull Builder setProrationMode(@NonNull Long setterArg) {
- this.prorationMode = setterArg;
+ public @NonNull Builder setPurchaseTime(@NonNull Long setterArg) {
+ this.purchaseTime = setterArg;
return this;
}
- private @Nullable String offerToken;
+ private @Nullable String developerPayload;
@CanIgnoreReturnValue
- public @NonNull Builder setOfferToken(@Nullable String setterArg) {
- this.offerToken = setterArg;
+ public @NonNull Builder setDeveloperPayload(@Nullable String setterArg) {
+ this.developerPayload = setterArg;
return this;
}
- private @Nullable String accountId;
+ private @Nullable String originalJson;
@CanIgnoreReturnValue
- public @NonNull Builder setAccountId(@Nullable String setterArg) {
- this.accountId = setterArg;
+ public @NonNull Builder setOriginalJson(@NonNull String setterArg) {
+ this.originalJson = setterArg;
return this;
}
- private @Nullable String obfuscatedProfileId;
+ private @Nullable String purchaseToken;
@CanIgnoreReturnValue
- public @NonNull Builder setObfuscatedProfileId(@Nullable String setterArg) {
- this.obfuscatedProfileId = setterArg;
+ public @NonNull Builder setPurchaseToken(@NonNull String setterArg) {
+ this.purchaseToken = setterArg;
return this;
}
- private @Nullable String oldProduct;
+ private @Nullable String signature;
@CanIgnoreReturnValue
- public @NonNull Builder setOldProduct(@Nullable String setterArg) {
- this.oldProduct = setterArg;
+ public @NonNull Builder setSignature(@NonNull String setterArg) {
+ this.signature = setterArg;
return this;
}
- private @Nullable String purchaseToken;
+ private @Nullable List products;
@CanIgnoreReturnValue
- public @NonNull Builder setPurchaseToken(@Nullable String setterArg) {
- this.purchaseToken = setterArg;
+ public @NonNull Builder setProducts(@NonNull List setterArg) {
+ this.products = setterArg;
return this;
}
- public @NonNull PlatformBillingFlowParams build() {
- PlatformBillingFlowParams pigeonReturn = new PlatformBillingFlowParams();
- pigeonReturn.setProduct(product);
- pigeonReturn.setProrationMode(prorationMode);
- pigeonReturn.setOfferToken(offerToken);
- pigeonReturn.setAccountId(accountId);
- pigeonReturn.setObfuscatedProfileId(obfuscatedProfileId);
- pigeonReturn.setOldProduct(oldProduct);
+ public @NonNull PlatformPurchaseHistoryRecord build() {
+ PlatformPurchaseHistoryRecord pigeonReturn = new PlatformPurchaseHistoryRecord();
+ pigeonReturn.setQuantity(quantity);
+ pigeonReturn.setPurchaseTime(purchaseTime);
+ pigeonReturn.setDeveloperPayload(developerPayload);
+ pigeonReturn.setOriginalJson(originalJson);
pigeonReturn.setPurchaseToken(purchaseToken);
+ pigeonReturn.setSignature(signature);
+ pigeonReturn.setProducts(products);
return pigeonReturn;
}
}
@@ -679,37 +1846,38 @@ public static final class Builder {
@NonNull
ArrayList toList() {
ArrayList toListResult = new ArrayList(7);
- toListResult.add(product);
- toListResult.add(prorationMode);
- toListResult.add(offerToken);
- toListResult.add(accountId);
- toListResult.add(obfuscatedProfileId);
- toListResult.add(oldProduct);
+ toListResult.add(quantity);
+ toListResult.add(purchaseTime);
+ toListResult.add(developerPayload);
+ toListResult.add(originalJson);
toListResult.add(purchaseToken);
+ toListResult.add(signature);
+ toListResult.add(products);
return toListResult;
}
- static @NonNull PlatformBillingFlowParams fromList(@NonNull ArrayList list) {
- PlatformBillingFlowParams pigeonResult = new PlatformBillingFlowParams();
- Object product = list.get(0);
- pigeonResult.setProduct((String) product);
- Object prorationMode = list.get(1);
- pigeonResult.setProrationMode(
- (prorationMode == null)
+ static @NonNull PlatformPurchaseHistoryRecord fromList(@NonNull ArrayList list) {
+ PlatformPurchaseHistoryRecord pigeonResult = new PlatformPurchaseHistoryRecord();
+ Object quantity = list.get(0);
+ pigeonResult.setQuantity(
+ (quantity == null)
? null
- : ((prorationMode instanceof Integer)
- ? (Integer) prorationMode
- : (Long) prorationMode));
- Object offerToken = list.get(2);
- pigeonResult.setOfferToken((String) offerToken);
- Object accountId = list.get(3);
- pigeonResult.setAccountId((String) accountId);
- Object obfuscatedProfileId = list.get(4);
- pigeonResult.setObfuscatedProfileId((String) obfuscatedProfileId);
- Object oldProduct = list.get(5);
- pigeonResult.setOldProduct((String) oldProduct);
- Object purchaseToken = list.get(6);
+ : ((quantity instanceof Integer) ? (Integer) quantity : (Long) quantity));
+ Object purchaseTime = list.get(1);
+ pigeonResult.setPurchaseTime(
+ (purchaseTime == null)
+ ? null
+ : ((purchaseTime instanceof Integer) ? (Integer) purchaseTime : (Long) purchaseTime));
+ Object developerPayload = list.get(2);
+ pigeonResult.setDeveloperPayload((String) developerPayload);
+ Object originalJson = list.get(3);
+ pigeonResult.setOriginalJson((String) originalJson);
+ Object purchaseToken = list.get(4);
pigeonResult.setPurchaseToken((String) purchaseToken);
+ Object signature = list.get(5);
+ pigeonResult.setSignature((String) signature);
+ Object products = list.get(6);
+ pigeonResult.setProducts((List) products);
return pigeonResult;
}
}
@@ -734,21 +1902,17 @@ public void setBillingResult(@NonNull PlatformBillingResult setterArg) {
this.billingResult = setterArg;
}
- /**
- * A JSON-compatible list of purchase history records, where each entry in the list is a
- * Map JSON encoding of the record.
- */
- private @NonNull List purchaseHistoryRecordJsonList;
+ private @NonNull List purchases;
- public @NonNull List getPurchaseHistoryRecordJsonList() {
- return purchaseHistoryRecordJsonList;
+ public @NonNull List getPurchases() {
+ return purchases;
}
- public void setPurchaseHistoryRecordJsonList(@NonNull List setterArg) {
+ public void setPurchases(@NonNull List setterArg) {
if (setterArg == null) {
- throw new IllegalStateException("Nonnull field \"purchaseHistoryRecordJsonList\" is null.");
+ throw new IllegalStateException("Nonnull field \"purchases\" is null.");
}
- this.purchaseHistoryRecordJsonList = setterArg;
+ this.purchases = setterArg;
}
/** Constructor is non-public to enforce null safety; use Builder. */
@@ -764,18 +1928,18 @@ public static final class Builder {
return this;
}
- private @Nullable List purchaseHistoryRecordJsonList;
+ private @Nullable List purchases;
@CanIgnoreReturnValue
- public @NonNull Builder setPurchaseHistoryRecordJsonList(@NonNull List setterArg) {
- this.purchaseHistoryRecordJsonList = setterArg;
+ public @NonNull Builder setPurchases(@NonNull List setterArg) {
+ this.purchases = setterArg;
return this;
}
public @NonNull PlatformPurchaseHistoryResponse build() {
PlatformPurchaseHistoryResponse pigeonReturn = new PlatformPurchaseHistoryResponse();
pigeonReturn.setBillingResult(billingResult);
- pigeonReturn.setPurchaseHistoryRecordJsonList(purchaseHistoryRecordJsonList);
+ pigeonReturn.setPurchases(purchases);
return pigeonReturn;
}
}
@@ -784,7 +1948,7 @@ public static final class Builder {
ArrayList toList() {
ArrayList toListResult = new ArrayList(2);
toListResult.add((billingResult == null) ? null : billingResult.toList());
- toListResult.add(purchaseHistoryRecordJsonList);
+ toListResult.add(purchases);
return toListResult;
}
@@ -795,8 +1959,8 @@ ArrayList toList() {
(billingResult == null)
? null
: PlatformBillingResult.fromList((ArrayList) billingResult));
- Object purchaseHistoryRecordJsonList = list.get(1);
- pigeonResult.setPurchaseHistoryRecordJsonList((List) purchaseHistoryRecordJsonList);
+ Object purchases = list.get(1);
+ pigeonResult.setPurchases((List) purchases);
return pigeonResult;
}
}
@@ -821,21 +1985,17 @@ public void setBillingResult(@NonNull PlatformBillingResult setterArg) {
this.billingResult = setterArg;
}
- /**
- * A JSON-compatible list of purchases, where each entry in the list is a Map
- * JSON encoding of the product details.
- */
- private @NonNull List purchasesJsonList;
+ private @NonNull List purchases;
- public @NonNull List getPurchasesJsonList() {
- return purchasesJsonList;
+ public @NonNull List getPurchases() {
+ return purchases;
}
- public void setPurchasesJsonList(@NonNull List setterArg) {
+ public void setPurchases(@NonNull List setterArg) {
if (setterArg == null) {
- throw new IllegalStateException("Nonnull field \"purchasesJsonList\" is null.");
+ throw new IllegalStateException("Nonnull field \"purchases\" is null.");
}
- this.purchasesJsonList = setterArg;
+ this.purchases = setterArg;
}
/** Constructor is non-public to enforce null safety; use Builder. */
@@ -851,18 +2011,18 @@ public static final class Builder {
return this;
}
- private @Nullable List purchasesJsonList;
+ private @Nullable List purchases;
@CanIgnoreReturnValue
- public @NonNull Builder setPurchasesJsonList(@NonNull List setterArg) {
- this.purchasesJsonList = setterArg;
+ public @NonNull Builder setPurchases(@NonNull List setterArg) {
+ this.purchases = setterArg;
return this;
}
public @NonNull PlatformPurchasesResponse build() {
PlatformPurchasesResponse pigeonReturn = new PlatformPurchasesResponse();
pigeonReturn.setBillingResult(billingResult);
- pigeonReturn.setPurchasesJsonList(purchasesJsonList);
+ pigeonReturn.setPurchases(purchases);
return pigeonReturn;
}
}
@@ -871,7 +2031,7 @@ public static final class Builder {
ArrayList toList() {
ArrayList toListResult = new ArrayList(2);
toListResult.add((billingResult == null) ? null : billingResult.toList());
- toListResult.add(purchasesJsonList);
+ toListResult.add(purchases);
return toListResult;
}
@@ -882,8 +2042,159 @@ ArrayList toList() {
(billingResult == null)
? null
: PlatformBillingResult.fromList((ArrayList) billingResult));
- Object purchasesJsonList = list.get(1);
- pigeonResult.setPurchasesJsonList((List) purchasesJsonList);
+ Object purchases = list.get(1);
+ pigeonResult.setPurchases((List) purchases);
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of Java ProductDetails.SubscriptionOfferDetails.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformSubscriptionOfferDetails {
+ private @NonNull String basePlanId;
+
+ public @NonNull String getBasePlanId() {
+ return basePlanId;
+ }
+
+ public void setBasePlanId(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"basePlanId\" is null.");
+ }
+ this.basePlanId = setterArg;
+ }
+
+ private @Nullable String offerId;
+
+ public @Nullable String getOfferId() {
+ return offerId;
+ }
+
+ public void setOfferId(@Nullable String setterArg) {
+ this.offerId = setterArg;
+ }
+
+ private @NonNull String offerToken;
+
+ public @NonNull String getOfferToken() {
+ return offerToken;
+ }
+
+ public void setOfferToken(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"offerToken\" is null.");
+ }
+ this.offerToken = setterArg;
+ }
+
+ private @NonNull List offerTags;
+
+ public @NonNull List getOfferTags() {
+ return offerTags;
+ }
+
+ public void setOfferTags(@NonNull List setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"offerTags\" is null.");
+ }
+ this.offerTags = setterArg;
+ }
+
+ private @NonNull List pricingPhases;
+
+ public @NonNull List getPricingPhases() {
+ return pricingPhases;
+ }
+
+ public void setPricingPhases(@NonNull List setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"pricingPhases\" is null.");
+ }
+ this.pricingPhases = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformSubscriptionOfferDetails() {}
+
+ public static final class Builder {
+
+ private @Nullable String basePlanId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setBasePlanId(@NonNull String setterArg) {
+ this.basePlanId = setterArg;
+ return this;
+ }
+
+ private @Nullable String offerId;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOfferId(@Nullable String setterArg) {
+ this.offerId = setterArg;
+ return this;
+ }
+
+ private @Nullable String offerToken;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOfferToken(@NonNull String setterArg) {
+ this.offerToken = setterArg;
+ return this;
+ }
+
+ private @Nullable List offerTags;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOfferTags(@NonNull List setterArg) {
+ this.offerTags = setterArg;
+ return this;
+ }
+
+ private @Nullable List pricingPhases;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setPricingPhases(@NonNull List setterArg) {
+ this.pricingPhases = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformSubscriptionOfferDetails build() {
+ PlatformSubscriptionOfferDetails pigeonReturn = new PlatformSubscriptionOfferDetails();
+ pigeonReturn.setBasePlanId(basePlanId);
+ pigeonReturn.setOfferId(offerId);
+ pigeonReturn.setOfferToken(offerToken);
+ pigeonReturn.setOfferTags(offerTags);
+ pigeonReturn.setPricingPhases(pricingPhases);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(5);
+ toListResult.add(basePlanId);
+ toListResult.add(offerId);
+ toListResult.add(offerToken);
+ toListResult.add(offerTags);
+ toListResult.add(pricingPhases);
+ return toListResult;
+ }
+
+ static @NonNull PlatformSubscriptionOfferDetails fromList(@NonNull ArrayList list) {
+ PlatformSubscriptionOfferDetails pigeonResult = new PlatformSubscriptionOfferDetails();
+ Object basePlanId = list.get(0);
+ pigeonResult.setBasePlanId((String) basePlanId);
+ Object offerId = list.get(1);
+ pigeonResult.setOfferId((String) offerId);
+ Object offerToken = list.get(2);
+ pigeonResult.setOfferToken((String) offerToken);
+ Object offerTags = list.get(3);
+ pigeonResult.setOfferTags((List) offerTags);
+ Object pricingPhases = list.get(4);
+ pigeonResult.setPricingPhases((List) pricingPhases);
return pigeonResult;
}
}
@@ -917,21 +2228,17 @@ public void setExternalTransactionToken(@NonNull String setterArg) {
this.externalTransactionToken = setterArg;
}
- /**
- * A JSON-compatible list of products, where each entry in the list is a Map
- * JSON encoding of the product.
- */
- private @NonNull List productsJsonList;
+ private @NonNull List products;
- public @NonNull List getProductsJsonList() {
- return productsJsonList;
+ public @NonNull List getProducts() {
+ return products;
}
- public void setProductsJsonList(@NonNull List setterArg) {
+ public void setProducts(@NonNull List setterArg) {
if (setterArg == null) {
- throw new IllegalStateException("Nonnull field \"productsJsonList\" is null.");
+ throw new IllegalStateException("Nonnull field \"products\" is null.");
}
- this.productsJsonList = setterArg;
+ this.products = setterArg;
}
/** Constructor is non-public to enforce null safety; use Builder. */
@@ -955,11 +2262,11 @@ public static final class Builder {
return this;
}
- private @Nullable List productsJsonList;
+ private @Nullable List products;
@CanIgnoreReturnValue
- public @NonNull Builder setProductsJsonList(@NonNull List setterArg) {
- this.productsJsonList = setterArg;
+ public @NonNull Builder setProducts(@NonNull List setterArg) {
+ this.products = setterArg;
return this;
}
@@ -967,7 +2274,7 @@ public static final class Builder {
PlatformUserChoiceDetails pigeonReturn = new PlatformUserChoiceDetails();
pigeonReturn.setOriginalExternalTransactionId(originalExternalTransactionId);
pigeonReturn.setExternalTransactionToken(externalTransactionToken);
- pigeonReturn.setProductsJsonList(productsJsonList);
+ pigeonReturn.setProducts(products);
return pigeonReturn;
}
}
@@ -977,7 +2284,7 @@ ArrayList toList() {
ArrayList toListResult = new ArrayList(3);
toListResult.add(originalExternalTransactionId);
toListResult.add(externalTransactionToken);
- toListResult.add(productsJsonList);
+ toListResult.add(products);
return toListResult;
}
@@ -987,8 +2294,109 @@ ArrayList toList() {
pigeonResult.setOriginalExternalTransactionId((String) originalExternalTransactionId);
Object externalTransactionToken = list.get(1);
pigeonResult.setExternalTransactionToken((String) externalTransactionToken);
- Object productsJsonList = list.get(2);
- pigeonResult.setProductsJsonList((List) productsJsonList);
+ Object products = list.get(2);
+ pigeonResult.setProducts((List) products);
+ return pigeonResult;
+ }
+ }
+
+ /**
+ * Pigeon version of UserChoiseDetails.Product.
+ *
+ * Generated class from Pigeon that represents data sent in messages.
+ */
+ public static final class PlatformUserChoiceProduct {
+ private @NonNull String id;
+
+ public @NonNull String getId() {
+ return id;
+ }
+
+ public void setId(@NonNull String setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"id\" is null.");
+ }
+ this.id = setterArg;
+ }
+
+ private @Nullable String offerToken;
+
+ public @Nullable String getOfferToken() {
+ return offerToken;
+ }
+
+ public void setOfferToken(@Nullable String setterArg) {
+ this.offerToken = setterArg;
+ }
+
+ private @NonNull PlatformProductType type;
+
+ public @NonNull PlatformProductType getType() {
+ return type;
+ }
+
+ public void setType(@NonNull PlatformProductType setterArg) {
+ if (setterArg == null) {
+ throw new IllegalStateException("Nonnull field \"type\" is null.");
+ }
+ this.type = setterArg;
+ }
+
+ /** Constructor is non-public to enforce null safety; use Builder. */
+ PlatformUserChoiceProduct() {}
+
+ public static final class Builder {
+
+ private @Nullable String id;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setId(@NonNull String setterArg) {
+ this.id = setterArg;
+ return this;
+ }
+
+ private @Nullable String offerToken;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setOfferToken(@Nullable String setterArg) {
+ this.offerToken = setterArg;
+ return this;
+ }
+
+ private @Nullable PlatformProductType type;
+
+ @CanIgnoreReturnValue
+ public @NonNull Builder setType(@NonNull PlatformProductType setterArg) {
+ this.type = setterArg;
+ return this;
+ }
+
+ public @NonNull PlatformUserChoiceProduct build() {
+ PlatformUserChoiceProduct pigeonReturn = new PlatformUserChoiceProduct();
+ pigeonReturn.setId(id);
+ pigeonReturn.setOfferToken(offerToken);
+ pigeonReturn.setType(type);
+ return pigeonReturn;
+ }
+ }
+
+ @NonNull
+ ArrayList toList() {
+ ArrayList toListResult = new ArrayList(3);
+ toListResult.add(id);
+ toListResult.add(offerToken);
+ toListResult.add(type == null ? null : type.index);
+ return toListResult;
+ }
+
+ static @NonNull PlatformUserChoiceProduct fromList(@NonNull ArrayList list) {
+ PlatformUserChoiceProduct pigeonResult = new PlatformUserChoiceProduct();
+ Object id = list.get(0);
+ pigeonResult.setId((String) id);
+ Object offerToken = list.get(1);
+ pigeonResult.setOfferToken((String) offerToken);
+ Object type = list.get(2);
+ pigeonResult.setType(PlatformProductType.values()[(int) type]);
return pigeonResult;
}
}
@@ -1027,22 +2435,37 @@ private InAppPurchaseApiCodec() {}
protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) {
switch (type) {
case (byte) 128:
+ return PlatformAccountIdentifiers.fromList((ArrayList) readValue(buffer));
+ case (byte) 129:
return PlatformAlternativeBillingOnlyReportingDetailsResponse.fromList(
(ArrayList) readValue(buffer));
- case (byte) 129:
- return PlatformBillingConfigResponse.fromList((ArrayList) readValue(buffer));
case (byte) 130:
- return PlatformBillingFlowParams.fromList((ArrayList) readValue(buffer));
+ return PlatformBillingConfigResponse.fromList((ArrayList) readValue(buffer));
case (byte) 131:
- return PlatformBillingResult.fromList((ArrayList) readValue(buffer));
+ return PlatformBillingFlowParams.fromList((ArrayList) readValue(buffer));
case (byte) 132:
- return PlatformProduct.fromList((ArrayList) readValue(buffer));
+ return PlatformBillingResult.fromList((ArrayList) readValue(buffer));
case (byte) 133:
- return PlatformProductDetailsResponse.fromList((ArrayList) readValue(buffer));
+ return PlatformOneTimePurchaseOfferDetails.fromList(
+ (ArrayList) readValue(buffer));
case (byte) 134:
- return PlatformPurchaseHistoryResponse.fromList((ArrayList) readValue(buffer));
+ return PlatformPricingPhase.fromList((ArrayList) readValue(buffer));
case (byte) 135:
+ return PlatformProductDetails.fromList((ArrayList) readValue(buffer));
+ case (byte) 136:
+ return PlatformProductDetailsResponse.fromList((ArrayList) readValue(buffer));
+ case (byte) 137:
+ return PlatformPurchase.fromList((ArrayList) readValue(buffer));
+ case (byte) 138:
+ return PlatformPurchaseHistoryRecord.fromList((ArrayList) readValue(buffer));
+ case (byte) 139:
+ return PlatformPurchaseHistoryResponse.fromList((ArrayList) readValue(buffer));
+ case (byte) 140:
return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer));
+ case (byte) 141:
+ return PlatformQueryProduct.fromList((ArrayList) readValue(buffer));
+ case (byte) 142:
+ return PlatformSubscriptionOfferDetails.fromList((ArrayList) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
@@ -1050,31 +2473,52 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) {
@Override
protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) {
- if (value instanceof PlatformAlternativeBillingOnlyReportingDetailsResponse) {
+ if (value instanceof PlatformAccountIdentifiers) {
stream.write(128);
+ writeValue(stream, ((PlatformAccountIdentifiers) value).toList());
+ } else if (value instanceof PlatformAlternativeBillingOnlyReportingDetailsResponse) {
+ stream.write(129);
writeValue(
stream, ((PlatformAlternativeBillingOnlyReportingDetailsResponse) value).toList());
} else if (value instanceof PlatformBillingConfigResponse) {
- stream.write(129);
+ stream.write(130);
writeValue(stream, ((PlatformBillingConfigResponse) value).toList());
} else if (value instanceof PlatformBillingFlowParams) {
- stream.write(130);
+ stream.write(131);
writeValue(stream, ((PlatformBillingFlowParams) value).toList());
} else if (value instanceof PlatformBillingResult) {
- stream.write(131);
- writeValue(stream, ((PlatformBillingResult) value).toList());
- } else if (value instanceof PlatformProduct) {
stream.write(132);
- writeValue(stream, ((PlatformProduct) value).toList());
- } else if (value instanceof PlatformProductDetailsResponse) {
+ writeValue(stream, ((PlatformBillingResult) value).toList());
+ } else if (value instanceof PlatformOneTimePurchaseOfferDetails) {
stream.write(133);
+ writeValue(stream, ((PlatformOneTimePurchaseOfferDetails) value).toList());
+ } else if (value instanceof PlatformPricingPhase) {
+ stream.write(134);
+ writeValue(stream, ((PlatformPricingPhase) value).toList());
+ } else if (value instanceof PlatformProductDetails) {
+ stream.write(135);
+ writeValue(stream, ((PlatformProductDetails) value).toList());
+ } else if (value instanceof PlatformProductDetailsResponse) {
+ stream.write(136);
writeValue(stream, ((PlatformProductDetailsResponse) value).toList());
+ } else if (value instanceof PlatformPurchase) {
+ stream.write(137);
+ writeValue(stream, ((PlatformPurchase) value).toList());
+ } else if (value instanceof PlatformPurchaseHistoryRecord) {
+ stream.write(138);
+ writeValue(stream, ((PlatformPurchaseHistoryRecord) value).toList());
} else if (value instanceof PlatformPurchaseHistoryResponse) {
- stream.write(134);
+ stream.write(139);
writeValue(stream, ((PlatformPurchaseHistoryResponse) value).toList());
} else if (value instanceof PlatformPurchasesResponse) {
- stream.write(135);
+ stream.write(140);
writeValue(stream, ((PlatformPurchasesResponse) value).toList());
+ } else if (value instanceof PlatformQueryProduct) {
+ stream.write(141);
+ writeValue(stream, ((PlatformQueryProduct) value).toList());
+ } else if (value instanceof PlatformSubscriptionOfferDetails) {
+ stream.write(142);
+ writeValue(stream, ((PlatformSubscriptionOfferDetails) value).toList());
} else {
super.writeValue(stream, value);
}
@@ -1125,7 +2569,7 @@ void queryPurchaseHistoryAsync(
* ProductDetailsResponseListener).
*/
void queryProductDetailsAsync(
- @NonNull List products,
+ @NonNull List products,
@NonNull Result result);
/** Wraps BillingClient#isFeatureSupported(String). */
@NonNull
@@ -1422,7 +2866,7 @@ public void error(Throwable error) {
(message, reply) -> {
ArrayList wrapped = new ArrayList();
ArrayList args = (ArrayList) message;
- List productsArg = (List) args.get(0);
+ List productsArg = (List) args.get(0);
Result resultCallback =
new Result() {
public void success(PlatformProductDetailsResponse result) {
@@ -1568,11 +3012,17 @@ private InAppPurchaseCallbackApiCodec() {}
protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) {
switch (type) {
case (byte) 128:
- return PlatformBillingResult.fromList((ArrayList) readValue(buffer));
+ return PlatformAccountIdentifiers.fromList((ArrayList) readValue(buffer));
case (byte) 129:
- return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer));
+ return PlatformBillingResult.fromList((ArrayList) readValue(buffer));
case (byte) 130:
+ return PlatformPurchase.fromList((ArrayList) readValue(buffer));
+ case (byte) 131:
+ return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer));
+ case (byte) 132:
return PlatformUserChoiceDetails.fromList((ArrayList) readValue(buffer));
+ case (byte) 133:
+ return PlatformUserChoiceProduct.fromList((ArrayList) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
@@ -1580,15 +3030,24 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) {
@Override
protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) {
- if (value instanceof PlatformBillingResult) {
+ if (value instanceof PlatformAccountIdentifiers) {
stream.write(128);
+ writeValue(stream, ((PlatformAccountIdentifiers) value).toList());
+ } else if (value instanceof PlatformBillingResult) {
+ stream.write(129);
writeValue(stream, ((PlatformBillingResult) value).toList());
+ } else if (value instanceof PlatformPurchase) {
+ stream.write(130);
+ writeValue(stream, ((PlatformPurchase) value).toList());
} else if (value instanceof PlatformPurchasesResponse) {
- stream.write(129);
+ stream.write(131);
writeValue(stream, ((PlatformPurchasesResponse) value).toList());
} else if (value instanceof PlatformUserChoiceDetails) {
- stream.write(130);
+ stream.write(132);
writeValue(stream, ((PlatformUserChoiceDetails) value).toList());
+ } else if (value instanceof PlatformUserChoiceProduct) {
+ stream.write(133);
+ writeValue(stream, ((PlatformUserChoiceProduct) value).toList());
} else {
super.writeValue(stream, value);
}
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
index c9543f13286..849337e21fb 100644
--- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
+++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
@@ -41,11 +41,11 @@
import io.flutter.plugins.inapppurchase.Messages.PlatformBillingChoiceMode;
import io.flutter.plugins.inapppurchase.Messages.PlatformBillingFlowParams;
import io.flutter.plugins.inapppurchase.Messages.PlatformBillingResult;
-import io.flutter.plugins.inapppurchase.Messages.PlatformProduct;
import io.flutter.plugins.inapppurchase.Messages.PlatformProductDetailsResponse;
import io.flutter.plugins.inapppurchase.Messages.PlatformProductType;
import io.flutter.plugins.inapppurchase.Messages.PlatformPurchaseHistoryResponse;
import io.flutter.plugins.inapppurchase.Messages.PlatformPurchasesResponse;
+import io.flutter.plugins.inapppurchase.Messages.PlatformQueryProduct;
import io.flutter.plugins.inapppurchase.Messages.Result;
import java.util.ArrayList;
import java.util.HashMap;
@@ -218,7 +218,7 @@ public Boolean isReady() {
@Override
public void queryProductDetailsAsync(
- @NonNull List products,
+ @NonNull List products,
@NonNull Result result) {
if (billingClient == null) {
result.error(getNullBillingClientError());
@@ -235,7 +235,7 @@ public void queryProductDetailsAsync(
final PlatformProductDetailsResponse.Builder responseBuilder =
new PlatformProductDetailsResponse.Builder()
.setBillingResult(fromBillingResult(billingResult))
- .setProductDetailsJsonList(fromProductDetailsList(productDetailsList));
+ .setProductDetails(fromProductDetailsList(productDetailsList));
result.success(responseBuilder.build());
});
} catch (RuntimeException e) {
@@ -397,7 +397,7 @@ public void queryPurchasesAsync(
PlatformPurchasesResponse.Builder builder =
new PlatformPurchasesResponse.Builder()
.setBillingResult(fromBillingResult(billingResult))
- .setPurchasesJsonList(fromPurchasesList(purchasesList));
+ .setPurchases(fromPurchasesList(purchasesList));
result.success(builder.build());
});
} catch (RuntimeException e) {
@@ -423,7 +423,7 @@ public void queryPurchaseHistoryAsync(
PlatformPurchaseHistoryResponse.Builder builder =
new PlatformPurchaseHistoryResponse.Builder()
.setBillingResult(fromBillingResult(billingResult))
- .setPurchaseHistoryRecordJsonList(fromPurchaseHistoryRecordList(purchasesList));
+ .setPurchases(fromPurchaseHistoryRecordList(purchasesList));
result.success(builder.build());
});
} catch (RuntimeException e) {
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/PluginPurchaseListener.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/PluginPurchaseListener.java
index e8f1b40aeb5..2dc99e73c23 100644
--- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/PluginPurchaseListener.java
+++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/PluginPurchaseListener.java
@@ -28,7 +28,7 @@ public void onPurchasesUpdated(
Messages.PlatformPurchasesResponse.Builder builder =
new Messages.PlatformPurchasesResponse.Builder()
.setBillingResult(fromBillingResult(billingResult))
- .setPurchasesJsonList(fromPurchasesList(purchases));
+ .setPurchases(fromPurchasesList(purchases));
callbackApi.onPurchasesUpdated(
builder.build(),
new Messages.VoidResult() {
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java
index 195cc7335ac..c06b3acfb50 100644
--- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java
+++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java
@@ -16,11 +16,26 @@
import com.android.billingclient.api.PurchaseHistoryRecord;
import com.android.billingclient.api.QueryProductDetailsParams;
import com.android.billingclient.api.UserChoiceDetails;
-import com.android.billingclient.api.UserChoiceDetails.Product;
+import io.flutter.plugins.inapppurchase.Messages.FlutterError;
+import io.flutter.plugins.inapppurchase.Messages.PlatformAccountIdentifiers;
+import io.flutter.plugins.inapppurchase.Messages.PlatformAlternativeBillingOnlyReportingDetailsResponse;
+import io.flutter.plugins.inapppurchase.Messages.PlatformBillingConfigResponse;
+import io.flutter.plugins.inapppurchase.Messages.PlatformBillingResult;
+import io.flutter.plugins.inapppurchase.Messages.PlatformOneTimePurchaseOfferDetails;
+import io.flutter.plugins.inapppurchase.Messages.PlatformPricingPhase;
+import io.flutter.plugins.inapppurchase.Messages.PlatformProductDetails;
+import io.flutter.plugins.inapppurchase.Messages.PlatformProductType;
+import io.flutter.plugins.inapppurchase.Messages.PlatformPurchase;
+import io.flutter.plugins.inapppurchase.Messages.PlatformPurchaseHistoryRecord;
+import io.flutter.plugins.inapppurchase.Messages.PlatformPurchaseState;
+import io.flutter.plugins.inapppurchase.Messages.PlatformQueryProduct;
+import io.flutter.plugins.inapppurchase.Messages.PlatformRecurrenceMode;
+import io.flutter.plugins.inapppurchase.Messages.PlatformSubscriptionOfferDetails;
+import io.flutter.plugins.inapppurchase.Messages.PlatformUserChoiceDetails;
+import io.flutter.plugins.inapppurchase.Messages.PlatformUserChoiceProduct;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Currency;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -29,45 +44,31 @@
* related objects.
*/
/*package*/ class Translator {
- static HashMap fromProductDetail(ProductDetails detail) {
- HashMap info = new HashMap<>();
- info.put("title", detail.getTitle());
- info.put("description", detail.getDescription());
- info.put("productId", detail.getProductId());
- info.put("productType", detail.getProductType());
- info.put("name", detail.getName());
-
- @Nullable
- ProductDetails.OneTimePurchaseOfferDetails oneTimePurchaseOfferDetails =
- detail.getOneTimePurchaseOfferDetails();
- if (oneTimePurchaseOfferDetails != null) {
- info.put(
- "oneTimePurchaseOfferDetails",
- fromOneTimePurchaseOfferDetails(oneTimePurchaseOfferDetails));
- }
-
- @Nullable
- List subscriptionOfferDetailsList =
- detail.getSubscriptionOfferDetails();
- if (subscriptionOfferDetailsList != null) {
- info.put(
- "subscriptionOfferDetails",
- fromSubscriptionOfferDetailsList(subscriptionOfferDetailsList));
- }
-
- return info;
+ static @NonNull PlatformProductDetails fromProductDetail(@NonNull ProductDetails detail) {
+ return new PlatformProductDetails.Builder()
+ .setTitle(detail.getTitle())
+ .setDescription(detail.getDescription())
+ .setProductId(detail.getProductId())
+ .setProductType(toPlatformProductType(detail.getProductType()))
+ .setName(detail.getName())
+ .setOneTimePurchaseOfferDetails(
+ fromOneTimePurchaseOfferDetails(detail.getOneTimePurchaseOfferDetails()))
+ .setSubscriptionOfferDetails(
+ fromSubscriptionOfferDetailsList(detail.getSubscriptionOfferDetails()))
+ .build();
}
- static List toProductList(
- List platformProducts) {
+ static @NonNull List toProductList(
+ @NonNull List platformProducts) {
List products = new ArrayList<>();
- for (Messages.PlatformProduct platformProduct : platformProducts) {
+ for (PlatformQueryProduct platformProduct : platformProducts) {
products.add(toProduct(platformProduct));
}
return products;
}
- static QueryProductDetailsParams.Product toProduct(Messages.PlatformProduct platformProduct) {
+ static @NonNull QueryProductDetailsParams.Product toProduct(
+ @NonNull PlatformQueryProduct platformProduct) {
return QueryProductDetailsParams.Product.newBuilder()
.setProductId(platformProduct.getProductId())
@@ -75,52 +76,60 @@ static QueryProductDetailsParams.Product toProduct(Messages.PlatformProduct plat
.build();
}
- static String toProductTypeString(Messages.PlatformProductType type) {
+ static @NonNull String toProductTypeString(PlatformProductType type) {
switch (type) {
case INAPP:
return BillingClient.ProductType.INAPP;
case SUBS:
return BillingClient.ProductType.SUBS;
}
- throw new Messages.FlutterError("UNKNOWN_TYPE", "Unknown product type: " + type, null);
+ throw new FlutterError("UNKNOWN_TYPE", "Unknown product type: " + type, null);
+ }
+
+ static PlatformProductType toPlatformProductType(@NonNull String typeString) {
+ switch (typeString) {
+ case BillingClient.ProductType.INAPP:
+ // Fallback handling to avoid throwing an exception if a new type is added in the future.
+ default:
+ return PlatformProductType.INAPP;
+ case BillingClient.ProductType.SUBS:
+ return PlatformProductType.SUBS;
+ }
}
- static List fromProductDetailsList(@Nullable List productDetailsList) {
+ static @NonNull List fromProductDetailsList(
+ @Nullable List productDetailsList) {
if (productDetailsList == null) {
return Collections.emptyList();
}
- // This and the method are generically typed due to Pigeon limitations; see
- // https://github.com/flutter/flutter/issues/116117.
- ArrayList output = new ArrayList<>();
+ ArrayList output = new ArrayList<>();
for (ProductDetails detail : productDetailsList) {
output.add(fromProductDetail(detail));
}
return output;
}
- static HashMap fromOneTimePurchaseOfferDetails(
+ static @Nullable PlatformOneTimePurchaseOfferDetails fromOneTimePurchaseOfferDetails(
@Nullable ProductDetails.OneTimePurchaseOfferDetails oneTimePurchaseOfferDetails) {
- HashMap serialized = new HashMap<>();
if (oneTimePurchaseOfferDetails == null) {
- return serialized;
+ return null;
}
- serialized.put("priceAmountMicros", oneTimePurchaseOfferDetails.getPriceAmountMicros());
- serialized.put("priceCurrencyCode", oneTimePurchaseOfferDetails.getPriceCurrencyCode());
- serialized.put("formattedPrice", oneTimePurchaseOfferDetails.getFormattedPrice());
-
- return serialized;
+ return new PlatformOneTimePurchaseOfferDetails.Builder()
+ .setPriceAmountMicros(oneTimePurchaseOfferDetails.getPriceAmountMicros())
+ .setPriceCurrencyCode(oneTimePurchaseOfferDetails.getPriceCurrencyCode())
+ .setFormattedPrice(oneTimePurchaseOfferDetails.getFormattedPrice())
+ .build();
}
- static List> fromSubscriptionOfferDetailsList(
+ static @Nullable List fromSubscriptionOfferDetailsList(
@Nullable List subscriptionOfferDetailsList) {
if (subscriptionOfferDetailsList == null) {
- return Collections.emptyList();
+ return null;
}
- ArrayList> serialized = new ArrayList<>();
-
+ ArrayList serialized = new ArrayList<>();
for (ProductDetails.SubscriptionOfferDetails subscriptionOfferDetails :
subscriptionOfferDetailsList) {
serialized.add(fromSubscriptionOfferDetails(subscriptionOfferDetails));
@@ -129,175 +138,182 @@ static List> fromSubscriptionOfferDetailsList(
return serialized;
}
- static HashMap fromSubscriptionOfferDetails(
- @Nullable ProductDetails.SubscriptionOfferDetails subscriptionOfferDetails) {
- HashMap serialized = new HashMap<>();
- if (subscriptionOfferDetails == null) {
- return serialized;
- }
-
- serialized.put("offerId", subscriptionOfferDetails.getOfferId());
- serialized.put("basePlanId", subscriptionOfferDetails.getBasePlanId());
- serialized.put("offerTags", subscriptionOfferDetails.getOfferTags());
- serialized.put("offerIdToken", subscriptionOfferDetails.getOfferToken());
-
- ProductDetails.PricingPhases pricingPhases = subscriptionOfferDetails.getPricingPhases();
- serialized.put("pricingPhases", fromPricingPhases(pricingPhases));
-
- return serialized;
+ static @NonNull PlatformSubscriptionOfferDetails fromSubscriptionOfferDetails(
+ @NonNull ProductDetails.SubscriptionOfferDetails subscriptionOfferDetails) {
+ return new PlatformSubscriptionOfferDetails.Builder()
+ .setOfferId(subscriptionOfferDetails.getOfferId())
+ .setBasePlanId(subscriptionOfferDetails.getBasePlanId())
+ .setOfferTags(subscriptionOfferDetails.getOfferTags())
+ .setOfferToken(subscriptionOfferDetails.getOfferToken())
+ .setPricingPhases(fromPricingPhases(subscriptionOfferDetails.getPricingPhases()))
+ .build();
}
- static List> fromPricingPhases(
+ static @NonNull List fromPricingPhases(
@NonNull ProductDetails.PricingPhases pricingPhases) {
- ArrayList> serialized = new ArrayList<>();
-
+ ArrayList serialized = new ArrayList<>();
for (ProductDetails.PricingPhase pricingPhase : pricingPhases.getPricingPhaseList()) {
serialized.add(fromPricingPhase(pricingPhase));
}
return serialized;
}
- static HashMap fromPricingPhase(
- @Nullable ProductDetails.PricingPhase pricingPhase) {
- HashMap serialized = new HashMap<>();
+ static @NonNull PlatformPricingPhase fromPricingPhase(
+ @NonNull ProductDetails.PricingPhase pricingPhase) {
+ return new PlatformPricingPhase.Builder()
+ .setFormattedPrice(pricingPhase.getFormattedPrice())
+ .setPriceCurrencyCode(pricingPhase.getPriceCurrencyCode())
+ .setPriceAmountMicros(pricingPhase.getPriceAmountMicros())
+ .setBillingCycleCount((long) pricingPhase.getBillingCycleCount())
+ .setBillingPeriod(pricingPhase.getBillingPeriod())
+ .setRecurrenceMode(toPlatformRecurrenceMode(pricingPhase.getRecurrenceMode()))
+ .build();
+ }
- if (pricingPhase == null) {
- return serialized;
+ static PlatformRecurrenceMode toPlatformRecurrenceMode(int mode) {
+ switch (mode) {
+ case ProductDetails.RecurrenceMode.FINITE_RECURRING:
+ return PlatformRecurrenceMode.FINITE_RECURRING;
+ case ProductDetails.RecurrenceMode.INFINITE_RECURRING:
+ return PlatformRecurrenceMode.INFINITE_RECURRING;
+ case ProductDetails.RecurrenceMode.NON_RECURRING:
+ return PlatformRecurrenceMode.NON_RECURRING;
}
+ return PlatformRecurrenceMode.NON_RECURRING;
+ }
- serialized.put("formattedPrice", pricingPhase.getFormattedPrice());
- serialized.put("priceCurrencyCode", pricingPhase.getPriceCurrencyCode());
- serialized.put("priceAmountMicros", pricingPhase.getPriceAmountMicros());
- serialized.put("billingCycleCount", pricingPhase.getBillingCycleCount());
- serialized.put("billingPeriod", pricingPhase.getBillingPeriod());
- serialized.put("recurrenceMode", pricingPhase.getRecurrenceMode());
-
- return serialized;
+ static PlatformPurchaseState toPlatformPurchaseState(int state) {
+ switch (state) {
+ case Purchase.PurchaseState.PURCHASED:
+ return PlatformPurchaseState.PURCHASED;
+ case Purchase.PurchaseState.PENDING:
+ return PlatformPurchaseState.PENDING;
+ case Purchase.PurchaseState.UNSPECIFIED_STATE:
+ return PlatformPurchaseState.UNSPECIFIED;
+ }
+ return PlatformPurchaseState.UNSPECIFIED;
}
- static HashMap fromPurchase(Purchase purchase) {
- HashMap info = new HashMap<>();
- List products = purchase.getProducts();
- info.put("orderId", purchase.getOrderId());
- info.put("packageName", purchase.getPackageName());
- info.put("purchaseTime", purchase.getPurchaseTime());
- info.put("purchaseToken", purchase.getPurchaseToken());
- info.put("signature", purchase.getSignature());
- info.put("products", products);
- info.put("isAutoRenewing", purchase.isAutoRenewing());
- info.put("originalJson", purchase.getOriginalJson());
- info.put("developerPayload", purchase.getDeveloperPayload());
- info.put("isAcknowledged", purchase.isAcknowledged());
- info.put("purchaseState", purchase.getPurchaseState());
- info.put("quantity", purchase.getQuantity());
+ static @NonNull PlatformPurchase fromPurchase(@NonNull Purchase purchase) {
+ PlatformPurchase.Builder builder =
+ new PlatformPurchase.Builder()
+ .setOrderId(purchase.getOrderId())
+ .setPackageName(purchase.getPackageName())
+ .setPurchaseTime(purchase.getPurchaseTime())
+ .setPurchaseToken(purchase.getPurchaseToken())
+ .setSignature(purchase.getSignature())
+ .setProducts(purchase.getProducts())
+ .setIsAutoRenewing(purchase.isAutoRenewing())
+ .setOriginalJson(purchase.getOriginalJson())
+ .setDeveloperPayload(purchase.getDeveloperPayload())
+ .setIsAcknowledged(purchase.isAcknowledged())
+ .setPurchaseState(toPlatformPurchaseState(purchase.getPurchaseState()))
+ .setQuantity((long) purchase.getQuantity());
AccountIdentifiers accountIdentifiers = purchase.getAccountIdentifiers();
if (accountIdentifiers != null) {
- info.put("obfuscatedAccountId", accountIdentifiers.getObfuscatedAccountId());
- info.put("obfuscatedProfileId", accountIdentifiers.getObfuscatedProfileId());
+ builder.setAccountIdentifiers(
+ new PlatformAccountIdentifiers.Builder()
+ .setObfuscatedAccountId(accountIdentifiers.getObfuscatedAccountId())
+ .setObfuscatedProfileId(accountIdentifiers.getObfuscatedProfileId())
+ .build());
}
- return info;
+ return builder.build();
}
- static HashMap fromPurchaseHistoryRecord(
- PurchaseHistoryRecord purchaseHistoryRecord) {
- HashMap info = new HashMap<>();
- List products = purchaseHistoryRecord.getProducts();
- info.put("purchaseTime", purchaseHistoryRecord.getPurchaseTime());
- info.put("purchaseToken", purchaseHistoryRecord.getPurchaseToken());
- info.put("signature", purchaseHistoryRecord.getSignature());
- info.put("products", products);
- info.put("developerPayload", purchaseHistoryRecord.getDeveloperPayload());
- info.put("originalJson", purchaseHistoryRecord.getOriginalJson());
- info.put("quantity", purchaseHistoryRecord.getQuantity());
- return info;
+ static @NonNull PlatformPurchaseHistoryRecord fromPurchaseHistoryRecord(
+ @NonNull PurchaseHistoryRecord purchaseHistoryRecord) {
+ return new PlatformPurchaseHistoryRecord.Builder()
+ .setPurchaseTime(purchaseHistoryRecord.getPurchaseTime())
+ .setPurchaseToken(purchaseHistoryRecord.getPurchaseToken())
+ .setSignature(purchaseHistoryRecord.getSignature())
+ .setProducts(purchaseHistoryRecord.getProducts())
+ .setDeveloperPayload(purchaseHistoryRecord.getDeveloperPayload())
+ .setOriginalJson(purchaseHistoryRecord.getOriginalJson())
+ .setQuantity((long) purchaseHistoryRecord.getQuantity())
+ .build();
}
- static List fromPurchasesList(@Nullable List purchases) {
+ static @NonNull List fromPurchasesList(@Nullable List purchases) {
if (purchases == null) {
return Collections.emptyList();
}
- // This and the method are generically typed due to Pigeon limitations; see
- // https://github.com/flutter/flutter/issues/116117.
- List serialized = new ArrayList<>();
+ List serialized = new ArrayList<>();
for (Purchase purchase : purchases) {
serialized.add(fromPurchase(purchase));
}
return serialized;
}
- static List fromPurchaseHistoryRecordList(
+ static @NonNull List fromPurchaseHistoryRecordList(
@Nullable List purchaseHistoryRecords) {
if (purchaseHistoryRecords == null) {
return Collections.emptyList();
}
- // This and the method are generically typed due to Pigeon limitations; see
- // https://github.com/flutter/flutter/issues/116117.
- List serialized = new ArrayList<>();
+ List serialized = new ArrayList<>();
for (PurchaseHistoryRecord purchaseHistoryRecord : purchaseHistoryRecords) {
serialized.add(fromPurchaseHistoryRecord(purchaseHistoryRecord));
}
return serialized;
}
- static Messages.PlatformBillingResult fromBillingResult(BillingResult billingResult) {
- return new Messages.PlatformBillingResult.Builder()
+ static @NonNull PlatformBillingResult fromBillingResult(@NonNull BillingResult billingResult) {
+ return new PlatformBillingResult.Builder()
.setResponseCode((long) billingResult.getResponseCode())
.setDebugMessage(billingResult.getDebugMessage())
.build();
}
- static Messages.PlatformUserChoiceDetails fromUserChoiceDetails(
- UserChoiceDetails userChoiceDetails) {
- return new Messages.PlatformUserChoiceDetails.Builder()
+ static @NonNull PlatformUserChoiceDetails fromUserChoiceDetails(
+ @NonNull UserChoiceDetails userChoiceDetails) {
+ return new PlatformUserChoiceDetails.Builder()
.setExternalTransactionToken(userChoiceDetails.getExternalTransactionToken())
.setOriginalExternalTransactionId(userChoiceDetails.getOriginalExternalTransactionId())
- .setProductsJsonList(fromProductsList(userChoiceDetails.getProducts()))
+ .setProducts(fromUserChoiceProductsList(userChoiceDetails.getProducts()))
.build();
}
- static List fromProductsList(List productsList) {
+ static @NonNull List fromUserChoiceProductsList(
+ @NonNull List productsList) {
if (productsList.isEmpty()) {
return Collections.emptyList();
}
- // This and the method are generically typed due to Pigeon limitations; see
- // https://github.com/flutter/flutter/issues/116117.
- ArrayList output = new ArrayList<>();
- for (Product product : productsList) {
- output.add(fromProduct(product));
+ ArrayList output = new ArrayList<>();
+ for (UserChoiceDetails.Product product : productsList) {
+ output.add(fromUserChoiceProduct(product));
}
return output;
}
- static HashMap fromProduct(Product product) {
- HashMap