Home > AI > IOS > Speech >

ask permision again when user denied it

iOS will never prompt user again, so if user denied at the first time and need to grant permission later, you need to guide them to the Settings.

// ask permission again, prompt
if status == .denied && self.askTime > 1{
    DispatchQueue.main.async {
        UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
    }
}

Leave a Reply