Skip to content

Add a webview popup helper for contentpass.net flows - #11

Open
0x7f wants to merge 1 commit into
mainfrom
webview-popup-sdk-helper
Open

0x7f wants to merge 1 commit into
mainfrom
webview-popup-sdk-helper

Conversation

@0x7f

@0x7f 0x7f commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds ContentPassWebViewPopup, a UIKit helper that presents a my.contentpass.net/contentpass.com web flow (login, payment) in a native sheet sliding up over three quarters of the presenting view controller
  • Navigation stays in the sheet while it's on contentpass.net/contentpass.com (including subdomains and iframes, e.g. the third-party-cookie check on autologin.contentpass.com); navigating anywhere else dismisses the sheet and hands the destination URL back via a completion closure
  • Independent of ContentPass's auth state — no contentpass_configuration.json required
  • Adds WebViewPopupExample, a new SDK-backed example app demonstrating the full round trip: a webview loads a CMP page, hands a contentpass.net link off to the popup, and gets the destination URL back once the flow leaves contentpass.net/contentpass.com
  • Requires iOS 16 (gated with @available) for the custom 75%-height sheet detent; doesn't change the package's iOS 10 floor

Demo

A recording showing the behaviour. The demo is opened in the main webview. URLs containing contentpass.net are opened inside a popup. Handover into the main WebView, including exchange of token for a proper session cookie happen inside the webview again and successfully log the user in.

Screen.Recording.2026-09-25.at.11.04.48.mov

@0x7f
0x7f requested review from a team as code owners September 24, 2026 19:52
Apps that show a publisher's site in their own webview often need to
hand off contentpass.net web flows - login, payment - into a native
sheet instead of loading them inline. ContentPassWebViewPopup wraps
that: it presents the flow in a sheet sliding up over three quarters of
the presenting view controller, keeps navigation within
contentpass.net/contentpass.com inside the sheet, and dismisses it with
the destination URL once the flow navigates elsewhere so the host app
can load it in its own webview. It's independent of ContentPass's
authentication state and doesn't require a
contentpass_configuration.json.

WebViewPopupExample is a new, SDK-backed example app demonstrating the
full round trip: a webview loads a CMP page, hands a contentpass.net
link off to the popup, and gets the destination URL back once the flow
leaves contentpass.net/contentpass.com.
@0x7f
0x7f force-pushed the webview-popup-sdk-helper branch from b1f0de1 to a372627 Compare September 25, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant