Abhijit Kotangale
Abhijit Kotangale

Reputation: 37

SIRI Custom intent - How to show country list, its more than 50+ countries

Actually i want to show country list to user and user can select their country but in custom intent siri not going to showing all country list, Please refer screenshot below, thanks in advance

public func resolveCountry(for intent: VASValidationIntent, with completion: @escaping (VASValidationCountryResolutionResult) -> Void) {
    // Check if the country is not yet resolved (i.e., ambiguous)
    guard let country = intent.country else {
        
        // Map the country names to the custom 'Country' object or INObject if it's predefined
        let countryObjects = availableCountriesTen.map { name -> Country in
            let country = Country(identifier: name, display: name)
            return country
        }
        
        // Use the disambiguation response, passing the list of countries for Siri to choose from
        completion(.disambiguation(with: countryObjects))
        return
    }
    
    completion(.success(with: country))
}

siri issue

Upvotes: 0

Views: 11

Answers (0)

Related Questions