You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add returnURLScheme init for Venmo app switch
Add `init(webView:returnURLScheme:prefersEphemeralWebBrowserSession:)`, funneled
through a single internal designated init that also injects a `URLOpener` for
testing. When a returnURLScheme is provided and the Venmo app is installed,
configureWebView advertises that scheme to the JS layer as the return URL prefix
(getReturnUrlPrefix); otherwise it keeps the internal ASWeb callback scheme.
Adds MockURLOpener + tests for the scheme branching, demo Info.plist URL scheme
registration, and README/CHANGELOG updates.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix: use one effective return scheme across ASWeb and app switch
The web SDK reads getReturnUrlPrefix() for both the ASWeb popup and the Venmo
app switch, so the return scheme must be consistent everywhere. Previously only
getReturnUrlPrefix() switched to the merchant scheme (for Venmo) while the ASWeb
callbackURLScheme and the return-URL validation stayed hardcoded to the SDK
scheme, which broke the ASWeb popup return (endless spinner).
Compute the effective scheme once (merchant scheme when a returnURLScheme is
provided and the Venmo app is installed, otherwise the SDK callback scheme) and
use it for the user script prefix, the ASWebAuthenticationSession
callbackURLScheme, and constructJavaScriptCompletionResult validation. Adds a
configurable callbackURLScheme on WebAuthenticationSession and validation tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: refine returnURLScheme README/CHANGELOG wording
Also re-sync Podfile.lock checksum with main's merged Podfile.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Update Sources/PopupBridge/POPPopupBridge.swift
Co-authored-by: agedd <105314544+agedd@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Jax DesMarais-Leder <jdesmarais@paypal.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: agedd <105314544+agedd@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# PopupBridge iOS Release Notes
2
2
3
+
## unreleased
4
+
* Add `init(webView:returnURLScheme:prefersEphemeralWebBrowserSession:)` for the Venmo app switch flow. When a `returnURLScheme` is provided and the Venmo app is installed, PopupBridge sends that scheme to the web SDK as the return URL prefix (`window.popupBridge.getReturnUrlPrefix()`) so the Venmo app can deep-link back into your app.
5
+
3
6
## 3.0.0 (2025-04-01)
4
7
* Breaking Changes
5
8
* Bump minimum supported deployment target to iOS 16+
When the Venmo app is installed, PopupBridge sends this scheme to the web SDK as the return URL prefix (`window.popupBridge.getReturnUrlPrefix()`), so the Venmo app can deep-link back into your app. You must register the same scheme under `CFBundleURLTypes` in your app's `Info.plist`:
59
+
60
+
```xml
61
+
<key>CFBundleURLTypes</key>
62
+
<array>
63
+
<dict>
64
+
<key>CFBundleURLSchemes</key>
65
+
<array>
66
+
<string>your-app-scheme</string>
67
+
</array>
68
+
</dict>
69
+
</array>
70
+
```
71
+
72
+
Additionally, you must add this scheme to your applications URL types. All 3 cases must match exactly to return to your app as expected after completing the app switch flow.
/// Initialize a Popup Bridge for the standard browser-based (ASWeb) checkout flow.
27
41
/// - Parameters:
28
42
/// - webView: The web view to add a script message handler to. Do not change the web view's configuration or user content controller after initializing Popup Bridge.
29
43
/// - prefersEphemeralWebBrowserSession: A Boolean that, when true, requests that the browser does not share cookies
30
-
/// or other browsing data between the authenthication session and the user’s normal browser session.
44
+
/// or other browsing data between the authentication session and the user's normal browser session.
/// Initialize a Popup Bridge with a return URL scheme for app switch flows (e.g. Venmo).
57
+
///
58
+
/// When a `returnURLScheme` is provided and the Venmo app is installed, the flow app switches into
59
+
/// the Venmo app, which deep-links back into the app via this scheme. In that case the scheme is
60
+
/// advertised to the JavaScript layer as the return URL prefix (instead of the SDK's internal
61
+
/// ASWeb callback scheme).
62
+
/// - Parameters:
63
+
/// - webView: The web view to add a script message handler to. Do not change the web view's configuration or user content controller after initializing Popup Bridge.
64
+
/// - returnURLScheme: The URL scheme registered under `CFBundleURLTypes` in the app's `Info.plist`
65
+
/// that the Venmo app uses to deep-link back into the app.
66
+
/// - prefersEphemeralWebBrowserSession: A Boolean that, when true, requests that the browser does not share cookies
67
+
/// or other browsing data between the authentication session and the user's normal browser session.
0 commit comments