Mark A. Donohoe
Mark A. Donohoe

Reputation: 30428

If a user initially denied Siri support for your app, how can they later enable it?

Starting to play around with SiriKit. I wanted to test permissions as a first step, so I set up my app to use Siri, got the expected prompt, but purposefully declined the request to use Siri. As expected, the status returned 'Not authorized'.

However, subsequent attempts to re-enable Siri by changing its toggle in Settings seems to have no effect in re-enabling Siri for the app.

Here's the code I'm using to check...

override func viewDidLoad()
{
    super.viewDidLoad()

    // Prompt for Siri support   
    INPreferences.requestSiriAuthorization
    {
        status in

        switch status
        {
            case .notDetermined: print("Not yet determined.")
            case .restricted:    print("Restricted. The app is not authorized to use Siri services.")
            case .denied:        print("Not authorized. The user explicitly denied authorization for this app.")
            case .authorized:    print("Authorized. Siri is enabled and your app is authorized to interact with it.")
        }
    }
}

As mentioned above, I thought the answer to this was as simple as going into the settings app and enabling Siri support for that app there, but interestingly, the app seemed to already have access granted (the switch showed 'on') even though I had declined it via the prompt.

More confusing is even when I toggled that switch off, then on again, hoping to 'reset' it so to speak, my app still, and always reports that Siri isn't supported.

Even overriding the Siri switch in general, or resetting the simulator's contents and settings, then reinstalling the app, I still don't get prompted, meaning it still remembers my choice, and it's reporting that it's still not authorized.

So how does one change their initial choice from No to Yes in regards to Siri support?

Is this perhaps an issue with the simulator always reporting 'Not authorized' and this has to be tested on an actual device?

Update

Must've been a glitch in the simulator. Nothing I did in settings or in code or even resetting the simulator entirely changed it. However, I changed the bundle ID and everything started working as expected. I even changed it back and now the old one is working as expected.

Upvotes: 1

Views: 1280

Answers (1)

David Pasztor
David Pasztor

Reputation: 54745

As stated by the official documentation,

The first time you make this request, Siri prompts the user to grant or deny permission for your app to integrate with Siri. Subsequent calls to the method do not prompt the user again.

So once the user denies permission, they can only enable it from Settings. All you can do is show an alert to the user to enable Siri from Settings if they denied Siri permission.

Upvotes: 1

Related Questions