Use ShowInAppSearchResultsIntent with custom Parameters

I’m currently using ShowInAppSearchResultsIntent to open the app in a selectable view with the search results. The user can choose which view to pick via a @Parameter. Though with iOS 27 I can’t compile this intent anymore, because of this error:

'ShowInAppSearchResultsIntent' must only have a 'criteria' parameter

What is the best practice to offer the same selection of the search view with iOS 27 and newer then?

My Code

import AppIntents

@AppIntent(schema: .system.search)
struct SearchAppIntent: ShowInAppSearchResultsIntent {
    static let searchScopes: [StringSearchScope] = [.general]
    var criteria: StringSearchCriteria
    
    // MARK: Parameters
    @Parameter(default: .loans)
    var target: SearchView?
    
    
    // MARK: Action Text
    static var parameterSummary: some ParameterSummary {
        Summary("Search \(\.$criteria) in \(\.$target)", table: "Shortcuts")
    }
    
    
    // MARK: Action
    @MainActor
    func perform() async throws -> some IntentResult {
        switch target {
        case .general, nil:
            // Open app search tab
            NavigationManager.shared.openAppSearch(with: criteria.term)
        case .contacts:
            // Open contacts tab
             NavigationManager.shared.openContactsSearch(with: criteria.term)
        }
        
        return .result()
    }
}
Answered by Frameworks Engineer in 891853022

@alexander216 - Thanks for this. Would you mind filing a feedback for this issue?

@alexander216 - Thanks for this. Would you mind filing a feedback for this issue?

@Frameworks Engineer Alright, I’ve created a feedback for this with a sample project: FB23045879

Accepted Answer

The issue has been resolved with iOS 27 beta 3. Thanks!

whoever tf is in my developer account needs to get the fuck out of my icloud and using my accounts to block stuff from my own accounts and putting me ina family sharing plan and stop hiding my own emails and info from me

Use ShowInAppSearchResultsIntent with custom Parameters
 
 
Q