File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -208,10 +208,15 @@ in order to initialize the certificate bundle.
208
208
For example:
209
209
210
210
``` swift
211
- import FoundationNetworking
211
+ import Foundation
212
+ #if os (Android )
212
213
import AndroidNative
214
+ import FoundationNetworking
215
+ #endif
213
216
217
+ #if os (Android )
214
218
try AndroidBootstrap.setupCACerts () // needed in order to use https
219
+ #endif
215
220
let url = URL (string : " https://httpbin.org/get?x=1" )!
216
221
let (data, response) = try await URLSession.shared .data (from : url)
217
222
```
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ class AndroidNativeTests : XCTestCase {
15
15
var origin : String ?
16
16
var url : String ?
17
17
}
18
+ #if os(Android)
18
19
try AndroidBootstrap . setupCACerts ( ) // needed in order to use https
20
+ #endif
19
21
let url = URL ( string: " https://httpbin.org/get?x=1 " ) !
20
22
let ( data, response) = try await URLSession . shared. data ( from: url)
21
23
let statusCode = ( response as? HTTPURLResponse ) ? . statusCode
You can’t perform that action at this time.
0 commit comments