In-App Purchase (Android/iOS)
The In-App Purchase functionality allows you to enable seamless payments within your iOS application. Follow these steps to integrate and verify in-app purchases effectively.
Last updated
Was this helpful?
The In-App Purchase functionality allows you to enable seamless payments within your iOS application. Follow these steps to integrate and verify in-app purchases effectively.
Last updated
Was this helpful?
This document provides comprehensive instructions for implementing in-app purchases (IAP) in your Bubble.io application. By following these steps, you can offer subscription services, one-time purchases, and consumable items to your users on iOS and Android platforms.
Before starting the IAP configuration process, ensure you have:
An active Bubble.io account with editor access to your application
Developer accounts set up with Apple (Apple Developer Program) and/or Google (Google Play Developer Console)
Your app registered in App Store Connect (iOS) and/or Google Play Console (Android)
Products/subscriptions created in both platforms as needed
The Bubble.io webtonative plugin installed in your application (webtonative - In App Purchase plugin)
Create a button in your app (e.g., "Button Init IAP")
Set up a workflow triggered when the button is clicked
Add the "webtonative - In-App Purchase" action as Step 1
Configure the action with:
Google Play Product ID: Your product ID (e.g., test_product1234)
App Store Product ID: Your product ID (e.g., test_product123)
Product Type: INAPP or SUBS (subscription)
Check "Consumable" if the product is consumable
After the In-App Purchase action, add a "Schedule init payment verification" action
Configure it with:
Custom event: "init payment verification" (this name will be used in later steps)
Delay (seconds): 1 (or your preferred delay)
Create a custom workflow by clicking on the "Custom" event type
Name it "init payment verification" (must match the name used in Step 2)
This custom workflow will handle the verification process
You can add parameters if needed, but none are shown in the screenshot
Set the event color and workflow folder as desired
In your custom workflow, add the "webtonative - Verifying IAP Transaction" action
Configure it with:
iOS Secret: Enter your App Store shared secret (e.g., vs234bd34f404fd31bd2ac22)
IAP Verification Data: Use the dynamic data "init-webtonative's IAP Verification Data state"
Check "Is Test" if you're in testing mode
Set the "Only when" condition to run only when IAP Verification Data is not empty
Add the "webtonative - Grab IAP Transaction Data (only for checking) (testing)" action
This step is optional and mainly used for testing
Configure it to display:
result: Result of step 1's result
success: Result of step 1's success
message: Result of step 1's message
Is Already Purchased: Result of step 1's Is Already Purchased
This allows you to see and utilize the response data from the verification step
After setting up the basic workflow as shown in the screenshots, you should add further actions to handle successful and failed purchases:
Add a conditional step after verification:
For successful purchases:
Update the user's purchased items or subscription status
Show a success message
Unlock premium features
Record the transaction in your database
For failed purchases:
Show appropriate error message to the user
Log the error message (Result of step 1's message)
Offer retry options
Create a data type "Purchases" with the following fields:
User (User)
Product ID (Text)
Purchase Date (Date)
Transaction ID (Text, from verification result)
Status (Options: active, expired, canceled)
Platform (Options: iOS, Android)
Create sandbox testers in App Store Connect:
Go to "Users and Access" > "Sandbox" > "Testers"
Add test accounts with valid email addresses
On test devices:
Sign out of the production App Store account
Sign in with the sandbox tester account
Install your app and test purchases
For subscriptions, the renewal cycle is accelerated in the sandbox environment
Set up a testing track in the Google Play Console
Add test users to the test track
Publish your app to the test track
Have testers install the app from the test track
Enable test mode in your purchase workflows
Receipt Verification Fails: Ensure your shared secret is correctly entered in the verification step
Products Not Loading: Verify product IDs match exactly between Bubble and App Store Connect
Sandbox Environment Not Working: Make sure testers are signed in with sandbox accounts, not production accounts
Billing Client Initialization Fails: Check your package name and Google Play setup
Products Not Available: Verify products are active in Google Play Console
Verification Errors: Ensure your configuration is correct
Check the browser console for errors during testing
Use the "Grab IAP Transaction Data" step to debug verification responses
Ensure you're testing on actual devices rather than simulators
Verify that your app is properly signed and using the correct bundle ID/package name
The user clicks the purchase button
Initialize IAP with product information
Schedule verification after 1 second
Verify the purchase with app store servers
(Optional) Extract transaction details for debugging
Process the result and update user data accordingly
After completing all the steps in this guide, your Bubble.io application should be fully configured to handle in-app purchases across both iOS and Android platforms. Remember to thoroughly test all purchase flows before releasing to production, and implement proper server-side verification to prevent unauthorized access to premium features.