Skip to content

Commit

Permalink
refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Nov 20, 2024
1 parent 6c272f0 commit 89af438
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions x/examples/outline-pwa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ This code lab guides you through creating a censorship-resistant Android/iOS app

### iOS Integration
* Add the compiled `mobileproxy` static library to your Xcode project.
* In `OutlineBridgeViewController.swift`, override the `webView` method to inject the proxy configuration:
* Create a new file called `OutlineBridgeViewController.swift` that looks like the following:
```swift
import UIKit
import Capacitor
class OutlineBridgeViewController: CAPBridgeViewController {
private let proxyHost: String = "127.0.0.1"
private let proxyPort: String = "8080"
}
```
* Override the `webView` method to inject the proxy configuration:

```swift
override func webView(with frame: CGRect, configuration: WKWebViewConfiguration) -> WKWebView {
Expand All @@ -100,7 +110,18 @@ This code lab guides you through creating a censorship-resistant Android/iOS app
}
```
* In `AppDelegate.swift`, set up the dialer and start the proxy in `applicationDidBecomeActive`:
* In `AppDelegate.swift`, set the `rootViewController` to your new `OutlineBridgeViewController`:
```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window?.rootViewController = OutlineBridgeViewController()
return true
}
```
* Then, set up the dialer and start the proxy in `applicationDidBecomeActive`:
```swift
func applicationDidBecomeActive(_ application: UIApplication) {
Expand Down Expand Up @@ -167,7 +188,7 @@ This code lab guides you through creating a censorship-resistant Android/iOS app
}
```
* Proxy all app requests using `ProxyController`:
* Proxy all app requests after the proxy is initialized using `ProxyController`:
```kotlin
// NOTE: This affects all requests in the application
Expand Down

0 comments on commit 89af438

Please sign in to comment.