In-App Purchase - iOS Integration
Integrate iOS in-app purchases using the WebToNative JavaScript API. Enable secure subscriptions and one-time purchases in your app.
Initiate a Purchase
window.WTN.inAppPurchase({
productId: "Product Id of IAP",
accountToken: "11112222-3333-4444-5555-666677778888",
callback: function (data) {
if (data.isSuccess) {
// Send data.receiptData to your server to verify the transaction.
// refer: https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
console.log(data.receiptData);
}
},
});import { inAppPurchase } from "webtonative/InAppPurchase";
inAppPurchase({
productId: "Product Id of IAP",
accountToken: "11112222-3333-4444-5555-666677778888",
callback: (data) => {
if (data.isSuccess) {
// Send data.receiptData to your server to verify the transaction.
// refer: https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
console.log(data.receiptData);
}
},
});Key
Type
Required
Description
Key
Type
Description
Verify a Transaction
Auto-renewable Subscriptions
Fetch Previous Transactions
Key
Type
Required
Description
Key
Type
Description
Official References
Last updated