I was able to add shortcuts with parameters and use them from the Shprtcuts app in iOS 17, nevertheless Siri intent did never work.
I upgraded to iOS 18 my app and my mobile.
Now, the shortcut only appears in shortcuts app if no parameter is added to it. When I try to set a parameter, the shortcut does not appear any mora in Shortcuts app.
struct ShortcutsProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OpenAppIntent(),
phrases: [
"Show (.$screen) in (.applicationName)"
],
shortTitle: "Open",
systemImageName: "iphone.badge.play"
)
}
}
struct OpenAppIntent: AppIntent {
static var title: LocalizedStringResource = "Show"
static let description = IntentDescription("Shows a screen.")
static var openAppWhenRun: Bool = true
static var authenticationPolicy = IntentAuthenticationPolicy.alwaysAllowed
@Parameter(title: "screen")
var screen: String
@MainActor
func perform() async throws -> some IntentResult {
return .result()
}
}
extension ScreenOption: AppEntity {
struct OpenAppQuery: EntityQuery {
@IntentParameterDependency<OpenAppIntent>( \.$screen )
var openAppIntent
func entities(for: [ScreenOption.ID]) async throws -> [ScreenOption] {
return []
}
func suggestedEntities() async throws -> [ScreenOption] {
return []
}
}
var displayRepresentation: DisplayRepresentation {
.init(stringLiteral: "\(title)")
}
static var defaultQuery: OpenAppQuery = OpenAppQuery()
static var typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "Screen")
}
extension ScreenOption: EntityIdentifierConvertible {
static func entityIdentifier(for entityIdentifierString: String) -> ScreenOption? {
allCases.filter { $0.rawValue == entityIdentifierString }.first
}
public var entityIdentifierString: String {
rawValue
}
public init?(entityIdentifierString: String) {
guard let screenOption = ScreenOption.entityIdentifier(for: entityIdentifierString)
else { return nil }
self = screenOption
}
}
Post
Replies
Boosts
Views
Activity
Due to this include,
#include <resolv.h>
We get the following linking error,
ld: warning: text-based stub file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/lib/libresolv.tbd and library file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/lib/libresolv.dylib are out of sync. Falling back to library file for linking.
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/lib/libresolv.dylib, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/lib/libresolv.dylib (2 slices)
Undefined symbols for architecture i386:
"res9ninit", referenced from:
+[CCSDKDiagnostics isCurrentNetworkIPv6] in CCSDKDiagnostics.o
"res9getservers", referenced from:
+[CCSDKDiagnostics isCurrentNetworkIPv6] in CCSDKDiagnostics.o
"res9_ndestroy", referenced from:
+[CCSDKDiagnostics isCurrentNetworkIPv6] in CCSDKDiagnostics.o
ld: symbol(s) not found for architecture i386