react-native-qonversion
Version:
Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co
34 lines • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Used to provide all the necessary purchase data to the {@link Qonversion.updatePurchase} method.
* Can be created manually or using the {@link Product.toPurchaseUpdateModel} method.
*
* Requires Qonversion product identifiers - {@link productId} for the purchasing one and
* {@link oldProductId} for the purchased one.
*
* If {@link offerId} is not specified for Android, then the default offer will be applied.
* To know how we choose the default offer, see {@link ProductStoreDetails.defaultSubscriptionOfferDetails}.
*
* If you want to remove any intro/trial offer from the purchase on Android (use only a bare base plan),
* call the {@link removeOffer} method.
*/
class PurchaseUpdateModel {
productId;
oldProductId;
updatePolicy = null;
offerId = null;
applyOffer = true;
constructor(productId, oldProductId, updatePolicy = null, offerId = null) {
this.productId = productId;
this.oldProductId = oldProductId;
this.updatePolicy = updatePolicy;
this.offerId = offerId;
}
removeOffer() {
this.applyOffer = false;
return this;
}
}
exports.default = PurchaseUpdateModel;
//# sourceMappingURL=PurchaseUpdateModel.js.map