iOS WebView
Integrating the web onboarding flow into a WebView can be summed up in three straight forward steps:
- Setup permissions for the camera.
- Build the
WKWebView
. - Handle the redirect from
WKNavigationDelegate
.
Demo App
To see a full example or to follow along, you may download the demo project here.
Build the WebView
WKWebView
Create the URLRequest
Build the Initially loading Branch is simply a matter of providing the Branch accounts url to your webview with the appropriate parameters. There are various optional parameters in addition to what's seen below, which are documented here.
WKWebView
Load the WKNavigationDelegate
Implement Camera Permissions
Web onboarding requires access to the camera, so therefore requires the NSCameraUsageDescription
key in you app’s Info.plist
. For additional information you can check out Apple’s Developer Documentation.