Issue: unresolved variable(s) found: +applicationName
I don't know how to fix this warning. Also need help figuring out what the other warning is. All showed up after upgrading to Xcode 16.
Issue: unresolved variable(s) found: +applicationName
I don't know how to fix this warning. Also need help figuring out what the other warning is. All showed up after upgrading to Xcode 16.
Here is the build log.
That warning is part of the build process for App Shortcuts. Do all of the phrases in your app shortcuts contain the application name token?
— Ed Ford, DTS Engineer
What exactly do you mean by application name token? Here is an example of my current implementation.
struct CreateExercise: AppIntent {
static var title: LocalizedStringResource = "Create Exercise"
static var parameterSummary: some ParameterSummary {
Summary("Create \(\.$name)")
}
@Parameter(title: "Exercise Name")
var name: String
func perform() async throws -> some IntentResult {
async let exercises = ExerciseQuery().suggestedEntities()
var newExercise: FEExercise?
if let user = Auth.auth().currentUser {
let creator = ExerciseCreator(uid: user.uid)
let id = try await creator.addExercise(name: name, existingExercises: exercises)
newExercise = try await ExerciseQuery().entities(for: [id.documentID]).first
return .result(value: newExercise)
}
return .result(value: newExercise)
}
}
@available(iOS 16.0, *)
struct SetgraphShortcuts: AppShortcutsProvider {
static var shortcutTileColor: ShortcutTileColor = .lime
static var appShortcuts: [AppShortcut] = [
AppShortcut(intent: RecordSet(), phrases: ["Record Set in Setgraph", "Record Set", "Log Set", "Record a Set", "Log a Set"], systemImageName: "dumbbell"),
AppShortcut(intent: CreateExercise(), phrases: ["Create Exercise in Setgraph", "Create Exercise", "New Exercise", "Create a Exercise", "Create a New Exercise"], systemImageName: "dumbbell")
]
}
What exactly do you mean by application name token?
AppShortcut(intent: RecordSet(), phrases: ["Record Set in Setgraph", "Record Set", "Log Set", "Record a Set", "Log a Set"]
In these phrases, you need to include the special token presenting your application name. Here's an example from our sample code project:
AppShortcut(intent: OpenFavorites(), phrases: [
"Open Favorites in \(.applicationName)",
"Show my favorite \(.applicationName)"
],
shortTitle: "Open Favorites",
systemImageName: "star.circle")
—Ed Ford, DTS Engineer