In-App Purchase (iOS & Android)
Offer extra content using in-app purchases directly within your app and publish your app to the Apple and Google App Store.
Only for mobile apps: This component only works for mobile apps published to Apple App Store and Google Play.
Prerequisites
Before setting up in-app purchases, you must have:
- A PandaSuite subscription plan that supports mobile app publishing (Single, Full, or Multi plan)
- Created your application on App Store Connect for iOS
- Created your application on Google Play Console for Android
Create in-app purchase
Each in-app purchase has a unique identifier associated with your application. This identifier must be created in App Store Connect and Google Play.
Testing in-app purchases: You cannot test in-app purchase transactions in PandaSuite Viewer. For iOS, you must use TestFlight to test the full user experience. For Android, you must test with a signed APK file.
App Store Connect
Go to App Store Connect and select your application. In the sidebar under In-App Purchases, click Manage.
Click on + to add an in-app purchase.
Choose the in-app purchase type:
- Consumable
- Non-consumable
- Subscription with automatic renewal
- Subscription without automatic renewal
and click Create. If you don’t know which one to choose, please refer to Apple’s in-app purchase documentation.
Add the reference name, product ID, and a localized display name. Product ID will be required in the In-App Purchase component.
Set the pricing from the list: 0.99 / 1.99 / 2.99 / 3.99 …
Provide in-app purchase information.
Click Save.
Play Developer
Go to Google Play Console, select your application and choose Monetization > Products > In-app products.
Learn more in the Google Play Billing documentation.
Click on Add new product and choose between: Managed Product / Unmanaged product / Subscription.
Fill in the Product ID field by clicking on the app. Choose the same as Apple. Product ID will be required in the In-App Purchase component.
⚠️ Be careful not to use uppercase letters for Product ID
On Google Play, only identifiers written entirely in lowercase letters and without special characters are allowed.
To avoid any compatibility issues when publishing your app on Android later, we recommend creating your in-app purchase identifiers directly in lowercase, even for the iOS version.
Select the pricing.
Component characteristics
Properties
- Product ID: The unique identifier for your in-app purchase, created in App Store Connect and Google Play Console
- Type: The type of in-app purchase (InApp for standard purchases, Subscription for subscriptions)
Exposed properties
The component exposes the following data that can be bound to other components:
- Price: The product price formatted with the user’s local currency (e.g., “$2.99”, “2,99 €“)
Triggers
- None purchased: The content has not been purchased (persistent state that reflects the current purchase status)
- None purchased (pending): The purchase is awaiting confirmation (Android only, for delayed payment methods like bank transfers)
- Purchased: The purchase is confirmed (persistent state that reflects the current purchase status)
- Payment success: A payment transaction just succeeded (one-time event triggered immediately after payment)
- Payment pending: The payment is being processed (Android only, for asynchronous payment methods that require approval)
- Payment error: A payment transaction failed (one-time event triggered when payment fails)
Actions
- Purchase: Initiates the in-app purchase flow
- Restore purchase: Restores previously purchased items (required for iOS App Review)
- Manage subscriptions: Opens the subscription management page
Implement in-app purchase experience
Add the In-App Purchase component
Design your screens for your in-app purchase flow.
Click Components and add the In-app Purchase component. This is a non-graphic component; it will only appear in the Objects list.
In the Properties panel, configure the following:
- Product ID: The unique identifier you created in App Store Connect and Play Developer Console
- Type: Select the type that matches your in-app purchase configuration:
- InApp (default) - For consumable and non-consumable in-app purchases
- Subscription - For auto-renewable subscriptions
Best practice: Add the In-App Purchase component at the project level (not within a specific screen). This ensures the component is always loaded and the purchase state is available across all screens, regardless of where the user navigates in your app.
Trigger the purchase
Select the button or interactive element that will trigger the purchase and open the Interactivity panel.
Choose Single Tap and the action Interact with a component. Select the In-App Purchase component and choose the Purchase action.
Unlock content after purchase
Select the In-app Purchase component and open the Interactivity panel.
Choose the Purchased trigger and create an action to unlock your premium content (e.g., Go to a screen, Open a pop-up).
You can also use the Payment success and Payment error triggers to display feedback messages to the user.
Display the localized price
To display the product price in your app:
- Add a Text component where you want to show the price
- Select the text component and open the Properties panel
- Click the Data binding icon next to the Text property
- Select your In-App Purchase component as the data source
- Choose Price from the available properties
The price will automatically update once the product information is loaded from the store.
Testing in-app purchases
You cannot test in-app purchases in PandaSuite Viewer. Testing must be done with compiled builds on actual devices or simulators using the methods below.
iOS testing with TestFlight
To test in-app purchases on iOS:
- Upload your app to TestFlight
- Create sandbox test users in App Store Connect under Users and Access > Sandbox Testers (Apple documentation)
- Use a unique email that is NOT associated with an existing Apple ID
- These accounts are only for testing and cannot access the real App Store
- Sign out of your regular Apple ID on your test device (Settings > App Store)
- Install the app via TestFlight
- When prompted during a purchase, sign in with your sandbox test account
- Complete the purchase flow (no real charges will occur)
Sandbox test accounts can make unlimited test purchases. You can reset purchases for a sandbox tester in App Store Connect to test the “non-purchased” state again.
Android testing
To test in-app purchases on Android:
- Create a signed APK or AAB file
- Upload it to the Play Console as an internal test or closed test track
- Add test users under Setup > License testing (Google documentation)
- Internal testing users must be added to your tester list
- Closed testing requires users to accept an invitation link
- Wait a few hours for the product information to propagate (especially for new products)
- Install the app from the Play Store on your test device
- Test the purchase flow with your test account
License testers can make test purchases without real charges. You can also test with test cards for more realistic payment scenarios.
Important testing scenarios
Test the following scenarios to ensure proper handling:
- Purchase flow: Complete a standard purchase successfully
- Restore purchases: Test the restore functionality (required for iOS App Store approval)
- Already purchased: Try to purchase the same item again
- Cancelled purchase: Cancel during the payment flow
- Network interruption: Test with poor connectivity
- Pending payments: For Android, test with asynchronous payment methods if applicable
Test both the Purchase and Restore purchase actions thoroughly. Apple requires a visible restore option for non-consumable purchases and subscriptions.