Siri Custom Entent - Как показать список страны, его более 50+ странIOS

Программируем под IOS
Anonymous
Siri Custom Entent - Как показать список страны, его более 50+ стран

Сообщение Anonymous »

На самом деле я хочу показать список страны пользователю и пользователю может выбрать свою страну, но в пользовательском намерении Siri не собирается показывать список всех стран, пожалуйста, обратитесь к скриншоту ниже, заранее спасибо < /p>

Код: Выделить всё

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))
}


Подробнее здесь: https://stackoverflow.com/questions/794 ... -countries

Вернуться в «IOS»