@@ -50,6 +50,13 @@ public extension NextcloudKit {
5050 }
5151 }
5252
53+ func subscribingPushNotificationAsync( serverUrl: String , pushTokenHash: String , devicePublicKey: String , proxyServerUrl: String , account: String , options: NKRequestOptions = NKRequestOptions ( ) ) async -> ( account: String , deviceIdentifier: String ? , signature: String ? , publicKey: String ? , responseData: AFDataResponse < Data > ? , error: NKError ) {
54+ await withCheckedContinuation { continuation in
55+ subscribingPushNotification ( serverUrl: serverUrl, pushTokenHash: pushTokenHash, devicePublicKey: devicePublicKey, proxyServerUrl: proxyServerUrl, account: account, options: options, taskHandler: { _ in } , completion: { account, deviceIdentifier, signature, publicKey, responseData, error in continuation. resume ( returning: ( account, deviceIdentifier, signature, publicKey, responseData, error) )
56+ } )
57+ }
58+ }
59+
5360 func unsubscribingPushNotification( serverUrl: String ,
5461 account: String ,
5562 options: NKRequestOptions = NKRequestOptions ( ) ,
@@ -76,6 +83,15 @@ public extension NextcloudKit {
7683 }
7784 }
7885
86+ func unsubscribingPushNotificationAsync( serverUrl: String , account: String , options: NKRequestOptions = NKRequestOptions ( ) ) async -> ( account: String , responseData: AFDataResponse < Data > ? , error: NKError ) {
87+ await withCheckedContinuation { continuation in
88+ unsubscribingPushNotification ( serverUrl: serverUrl, account: account, options: options, taskHandler: { _ in } ,
89+ completion: { account, responseData, error in
90+ continuation. resume ( returning: ( account, responseData, error)
91+ ) }
92+ ) }
93+ }
94+
7995 func subscribingPushProxy( proxyServerUrl: String ,
8096 pushToken: String ,
8197 deviceIdentifier: String ,
@@ -113,6 +129,33 @@ public extension NextcloudKit {
113129 }
114130 }
115131
132+ func subscribingPushProxyAsync(
133+ proxyServerUrl: String ,
134+ pushToken: String ,
135+ deviceIdentifier: String ,
136+ signature: String ,
137+ publicKey: String ,
138+ account: String ,
139+ options: NKRequestOptions = NKRequestOptions ( ) ) async -> ( account: String ,
140+ responseData: AFDataResponse < Data > ? ,
141+ error: NKError ) {
142+ await withCheckedContinuation { continuation in
143+ subscribingPushProxy (
144+ proxyServerUrl: proxyServerUrl,
145+ pushToken: pushToken,
146+ deviceIdentifier: deviceIdentifier,
147+ signature: signature,
148+ publicKey: publicKey,
149+ account: account,
150+ options: options,
151+ taskHandler: { _ in } ,
152+ completion: { account, responseData, error in
153+ continuation. resume ( returning: ( account, responseData, error) )
154+ }
155+ )
156+ }
157+ }
158+
116159 func unsubscribingPushProxy( proxyServerUrl: String ,
117160 deviceIdentifier: String ,
118161 signature: String ,
@@ -147,4 +190,30 @@ public extension NextcloudKit {
147190 }
148191 }
149192 }
193+
194+ func unsubscribingPushProxyAsync(
195+ proxyServerUrl: String ,
196+ deviceIdentifier: String ,
197+ signature: String ,
198+ publicKey: String ,
199+ account: String ,
200+ options: NKRequestOptions = NKRequestOptions ( )
201+ ) async -> ( account: String ,
202+ responseData: AFDataResponse < Data > ? ,
203+ error: NKError ) {
204+ await withCheckedContinuation { continuation in
205+ unsubscribingPushProxy (
206+ proxyServerUrl: proxyServerUrl,
207+ deviceIdentifier: deviceIdentifier,
208+ signature: signature,
209+ publicKey: publicKey,
210+ account: account,
211+ options: options,
212+ taskHandler: { _ in } ,
213+ completion: { account, responseData, error in
214+ continuation. resume ( returning: ( account, responseData, error) )
215+ }
216+ )
217+ }
218+ }
150219}
0 commit comments