diff --git a/README.md b/README.md index fe1453c..5129049 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ ### Integration into Android -1. Create Fragment or Activity which contains WebView, it should load `https://[YOUR-SUBDOMAIN].dev.ballerine.app` (sanbox) or `https://[YOUR-SUBDOMAIN].ballerine.app` (prod) URL. -2. Set webViewSettings the following WebView settings: +1. Create a Fragment or Activity which contains the WebView, it should load `https://[YOUR-SUBDOMAIN].dev.ballerine.app` (sanbox) or `https://[YOUR-SUBDOMAIN].ballerine.app` (prod) URL. +2. Set webViewSettings to the following WebView settings: ```kt webviewSettings.javaScriptEnabled = true webviewSettings.domStorageEnabled = true webviewSettings.allowFileAccess = true ``` -3. Setup WebViewClient and WebChromeClient. In WebChromeClient override method `onShowFileChooser` the same way as it is implemented in `UserRegistrationFlowActivity`. -4. Add `onActivityResultListener` or `registerForActivityResult` to listen callback from the camera application: +3. Setup the WebViewClient and WebChromeClient. In WebChromeClient override the method `onShowFileChooser` the same way as it is implemented in `UserRegistrationFlowActivity`. +4. Add `onActivityResultListener` or `registerForActivityResult` to listen to the callback from the camera application: ```kt val resultCode = result.resultCode val data = result.data @@ -32,18 +32,18 @@ } } ``` -5. Create method that checking about finished state of the registration flow and save received results, see `checkWebViewUrl` method for more details. +5. Create a method that is checking for the finished state of the registration flow and saves the received results, see `checkWebViewUrl` method for more details. ### Integration into iOS -1. Add NSCameraUsageDescription key into Info.plist file. It's needed for camera usage. +1. Add the NSCameraUsageDescription key into Info.plist file. It's needed in order to use the camera. 2. Create UIViewController which contains WKWebView, it should load `https://[YOUR-SUBDOMAIN].dev.ballerine.app` (sanbox) or `https://[YOUR-SUBDOMAIN].ballerine.app` (prod) URL. -3. Add web view key-value observer for detect URL updates: +3. Add web view key-value observer to detect URL updates: ```swift webView.addObserver(self, forKeyPath: "URL", options: .new, context: nil) ``` -4. Implement observeValue forKeyPath method for handle URL updates: +4. Implement observeValue forKeyPath method to handle URL updates: ```swift override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard let key = change?[NSKeyValueChangeKey.newKey], let url = (key as? NSURL)?.absoluteString else { return } @@ -54,4 +54,4 @@ webView.addObserver(self, forKeyPath: "URL", options: .new, context: nil) } } ``` -5. Create method that checking about finished state of the registration flow and save received results, see `finishWithSecret` method for more details. +5. Create a method that is checking for the finished state of the registration flow and saves the received results, see `finishWithSecret` method for more details.