-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
Steps to Reproduce
I'm using in_app_purchase plugin version 0.3.4+3, and I notice that PurchaseParam has a confusing param.
sample code:
final PurchaseParam purchaseParam = PurchaseParam(
productDetails: productDetails,
sandboxTesting: true,
);
await InAppPurchaseConnection.instance
.buyNonConsumable(purchaseParam: purchaseParam);PurchaseParam has sandboxTesting param. This document says:
The 'sandboxTesting' is only available on iOS, set it to
truefor testing in AppStore's sandbox environment. The default value isfalse.
But this explanation seems to be wrong. In fact, it is only used to test Ask to Buy feature.
await _skPaymentQueueWrapper.addPayment(SKPaymentWrapper(
productIdentifier: purchaseParam.productDetails.id,
quantity: 1,
applicationUsername: purchaseParam.applicationUserName,
simulatesAskToBuyInSandbox: purchaseParam.sandboxTesting,
requestData: null));Furthermore, simulatesAskToBuyInSandbox isn't actually used because of typo.
payment.simulatesAskToBuyInSandbox =
[[paymentMap objectForKey:@"simulatesAskToBuyInSandBox"] boolValue];Correct key is simulatesAskToBuyInSandbox, but actual is simulatesAskToBuyInSandBox.
Expected results:
sandboxTesting is used to switch sandbox environment.
Actual results:
sandboxTesting is used to switch "Ask to Buy" feature, and furthermore, it is not working.
To switch sandbox environment, switch provisioning profile. This seems to be an iOS specification, so there seems to be no way to change it.