mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
opt.: watchOS & iOS widget (#847)
This commit is contained in:
@@ -44,7 +44,13 @@ class PhoneConnMgr: NSObject, WCSessionDelegate, ObservableObject {
|
||||
func updateUrls(_ val: [String: Any]) {
|
||||
if let urls = val["urls"] as? [String] {
|
||||
DispatchQueue.main.async {
|
||||
self.urls = urls.filter { !$0.isEmpty }
|
||||
let list = urls.filter { !$0.isEmpty }
|
||||
self.urls = list
|
||||
// Save URLs to App Group for widget access
|
||||
let appGroupId = "group.com.lollipopkit.toolbox"
|
||||
if let defaults = UserDefaults(suiteName: appGroupId) {
|
||||
defaults.set(list, forKey: "watch_shared_urls")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user