Posts

Post not yet marked as solved
1 Replies
384 Views
I am trying to add a watch widget that I've created for Smart Stack feature of watchOS 10 to also appear in the list of shortcuts shown in the Siri Watch Face. It seems like Apple now wants us to use RelevantIntentManager for this purpose, but my widget never shows up in the Siri Watch face. This is the code that I am using. func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<GenericEntry> { [...] await updateRelevantIntents() return timeline } func updateRelevantIntents() async { var relevantIntents = [RelevantIntent]() let defaults = UserDefaults.init(suiteName: "group.tesla.watch.maadotaa")! guard let name2VIN = defaults.dictionary(forKey: Constants.VEHICLE_NAME_VIN_DICT) as? [String:String] else { return } let carNames = Array(name2VIN.keys) for (idx, name) in carNames.enumerated() { let intent = ConfigurationAppIntent() intent.order = idx intent.carName = name intent.action = nil let txt = "\(name): info only" let relIntent = RelevantIntent(intent, widgetKind: "WatchWidget", relevance: RelevantContext.date(from: .now, to: .now + 3600 * 1)) relevantIntents.append(relIntent) } do { try await RelevantIntentManager.shared.updateRelevantIntents(relevantIntents) } catch (let error) { print("\(#function): \(error.localizedDescription)") } }
Posted
by MeanRaw.
Last updated
.
Post not yet marked as solved
0 Replies
213 Views
Is there is limit on the number of AppIntentRecommendation that we can return in the recommendations() delegate function (shown below)? watchOS 10 RC seem to limit this number to 15 and truncates if the length of the returned array is larger than 15. func recommendations() -> [AppIntentRecommendation<ConfigurationAppIntent>] {
Posted
by MeanRaw.
Last updated
.
Post not yet marked as solved
8 Replies
3.1k Views
In SwiftUI, Virtual Keyboard does not move TextField when the user taps on the TextField It works correctly on iPhone simulator (ie, the keyboard moves the TextField up so that it remains visible when the user taps on the TextField) but the keyboard cover the TextField on a real iPhone. It also works correctly on iPad. I filed a feedback. Do you see the same problem? Here is a code to reproduce the problem: import SwiftUI struct ContentView: View { @State private var name: String = "" var body: some View { ScrollView { Color.red .frame(height: 314) Color.yellow .frame(height: 314) } .padding() .scrollDismissesKeyboard(.interactively) TextField("Name:", text: $name) .padding() } }
Posted
by MeanRaw.
Last updated
.
Post not yet marked as solved
0 Replies
515 Views
I've tried MKMapSnapshotter in the TimelineProvider , but the completion handler of the start is never called (snapshot is a MKMapSnapshotter object and I have verified that the callback is called when this code runs on the actual app and not the widget TimelineProvider. What am I missing? &#9;&#9;snapshot.start { (snapshot, error) in       let image = Image(uiImage: snapshot?.image)       completionHandler(image)     }
Posted
by MeanRaw.
Last updated
.
Post not yet marked as solved
1 Replies
3.9k Views
The following WWDC session saya that the user can select a folder and we can read all files in a folderhttps://developer.apple.com/videos/play/wwdc2019/719/But the delegte is never called when the user taps on a folder. Does anybody know how the user can select a folder so that the app can get a callback with the URL of the selected folder.Here is the code that I am using: let documentPicker = UIDocumentPickerViewController(documentTypes: [String(kUTTypeFolder)], in: .open) documentPicker.delegate = self documentPicker.allowsMultipleSelection = true present(documentPicker, animated: true) { print("done presenting") }
Posted
by MeanRaw.
Last updated
.
Post not yet marked as solved
19 Replies
9.5k Views
I can install the watch app on my iPhone using Xcode fine (adHoc install also works). But, I get the following error when I (or my beta testers) try to install the watch app using TestFlight.Error: "Couldn't install &lt;app_name&gt; on Apple Watch"I found this message on the console. The provisioning profiles are handled by Xcode automatically. Previous build of this app had no problem with the Watch app installation via TestFlight, but now even previous builds in TestFlight refuse to install the watch app.Watch Install Update (for iOSAppID: ***, iOSBuildID: ***, buildVersion: 4.1.5 (16)): Could not find a matching profile. Profile bundleIDs: ( "***.watchkitapp.watchkitextension", "***.watchkitapp", "***.watchkitapp.watchkitextension.WatchOSIntents" )
Posted
by MeanRaw.
Last updated
.