Payment Configuration
The Hubble SDK supports UPI and card payments. Most payment flows work automatically, but native mobile apps require some configuration for UPI payments to work correctly.
If you are integrating the SDK as a web iframe only (not a native mobile app), you can skip this section. Payment configuration is only required for native iOS and Android apps.
iOS UPI Configuration
The iOS Limitation
iOS restricts apps from checking which other apps are installed on the device. This is a privacy feature. However, for UPI payments to work, the SDK needs to know which UPI apps (PhonePe, GPay, Paytm, etc.) are available so it can show the correct payment options.
Passing Installed UPI Apps
To enable UPI payments in your iOS app, you need to declare the UPI app URL schemes in your Info.plist. This allows your app to query which UPI apps are installed.
Add the following to your Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>phonepe</string>
<string>tez</string>
<string>paytmmp</string>
<string>cred</string>
<string>bhim</string>
</array>
Why This Matters
Without these URL schemes declared, iOS will not allow your app to check for installed UPI apps. The SDK will fall back to showing a generic "Pay via UPI" option, which may open the wrong app or fail entirely. With the schemes declared, the SDK can show specific buttons for each installed UPI app, providing a smoother payment experience.
iOS WebView Background Behavior
When a user taps a UPI app to complete payment, your app goes to the background and the UPI app opens. iOS may suspend your app's WebView while it is in the background, which can pause JavaScript execution.
When the user returns to your app after completing the payment, the WebView may have been suspended. JavaScript timers, network requests, and state updates may not have executed as expected.
Listen for the applicationDidBecomeActive notification in your app. When your app becomes active again after a UPI payment, you may need to refresh the WebView or call evaluateJavaScript to trigger a status check. The SDK handles most of this automatically, but if you see stale payment states, this is the likely cause.
Android Configuration
For Android apps, add the following queries to your AndroidManifest.xml to detect UPI apps:
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="upi" />
</intent>
</queries>
Android handles UPI payments through intents. For the WebView to open UPI apps, you need to ensure your WebView client properly handles intent:// URLs. The Android Integration Guide includes the necessary WebView configuration code.
Troubleshooting
UPI Apps Not Appearing (iOS)
- Verify the
LSApplicationQueriesSchemesare added to yourInfo.plist - Ensure you're using
WKWebView(notSFSafariViewController) - Rebuild your app after modifying
Info.plist
UPI Apps Not Appearing (Android)
- Verify the
<queries>block is present in yourAndroidManifest.xml - Ensure your WebView is configured to handle external intents
- On Android 11+, the package visibility rules require the queries declaration
Payment Status Stuck (iOS)
If the payment status screen appears stuck after returning from a UPI app:
- Implement
applicationDidBecomeActivehandling - Reload the WebView or trigger a JavaScript status check
- The SDK should auto-recover within a few seconds