Skip to content

Commit

Permalink
Minor text changes in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nitzanballerine authored Jul 26, 2022
1 parent 30ccd69 commit eb510b4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }
Expand All @@ -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.

0 comments on commit eb510b4

Please sign in to comment.