Update iOS ApiClient to handle token refresh

This commit is contained in:
advplyr
2025-07-05 16:46:37 -05:00
parent bc927d4c35
commit 5766c49f61
4 changed files with 393 additions and 22 deletions
+9
View File
@@ -53,6 +53,15 @@ public class AbsDatabase: CAPPlugin, CAPBridgedPlugin {
private let logger = AppLogger(category: "AbsDatabase")
private let secureStorage = SecureStorage()
// Used to notify the webview frontend that the token has been refreshed
static var tokenRefreshCallback: ((String, [String: Any]) -> Void)?
override public func load() {
AbsDatabase.tokenRefreshCallback = { [weak self] eventName, data in
self?.notifyListeners(eventName, data: data)
}
}
@objc func setCurrentServerConnectionConfig(_ call: CAPPluginCall) {
var id = call.getString("id")
let address = call.getString("address", "")