Skip to content

Commit 1bafbdc

Browse files
Merge pull request #717 from appwrite/fix-apple-xpc-interrupt
2 parents 058987c + 55ead1c commit 1bafbdc

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

templates/swift/Sources/Services/Service.swift.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ open class {{ service.name | caseUcfirst }}: Service {
3535
{%~ if 'multipart/form-data' in method.consumes %}
3636
onProgress: ((UploadProgress) -> Void)? = nil
3737
{%~ endif %}
38-
){%~ if method.type != "webAuth" %} async{% endif %} throws -> {{ method | returnType(spec) | raw }} {
38+
) async throws -> {{ method | returnType(spec) | raw }} {
3939
{{~ include('swift/base/params.twig') }}
4040
{%~ if method.type == 'webAuth' %}
41-
{{~ include('swift/base/requests/OAuth.twig') }}
41+
{{~ include('swift/base/requests/oauth.twig') }}
4242
{%~ elseif method.type == 'location' %}
4343
{{~ include('swift/base/requests/location.twig')}}
4444
{%~ else %}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
let query = "?\(client.parametersToQueryString(params: apiParams))"
22
let url = URL(string: client.endPoint + apiPath + query)!
33
let callbackScheme = "appwrite-callback-\(client.config["project"] ?? "")"
4-
let group = DispatchGroup()
54

6-
group.enter()
7-
WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in
8-
group.leave()
5+
try await withCheckedThrowingContinuation { continuation in
6+
WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in
7+
continuation.resume(with: result)
8+
}
99
}
10-
group.wait()
1110

1211
return true

0 commit comments

Comments
 (0)