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>] {
Post
Replies
Boosts
Views
Activity
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)")
}
}
I set the location permission to Always but it changes back to “when shared” after a few days. Is this a bug?
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()
}
}
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?
		snapshot.start { (snapshot, error) in
let image = Image(uiImage: snapshot?.image)
completionHandler(image)
}
Before Xcode 12 we could initiate a background fetch even using simulator, but that option does not exist in Xcode 12.
Is it moved somewhere else? How else can we simulate background fetch events for debugging?