Request permission from the user so that Siri and Maps can communicate with your Intents app extension.
- Bundle Resources
Siri and Maps can’t interact with your Intents app extension until the user authorizes them to do so. You request authorization from your iOS app, not your extension. The permissions granted by the user apply to both your iOS app and your watchOS app.
To request authorization:
Enable the Siri capability. Your iOS app or WatchKit extension must have the Siri capability enabled for authorization to succeed. For information about how to enable the Siri capability, see Creating an Intents App Extension.
Configure your Info.plist file. Include the
NSSirikey in your iOS app’s
Infofile. The value for this key is a string that describes what information your app shares with SiriKit. For example, a workout app might set the value to the string “Workout information will be sent to Siri.” Inclusion of this key is required.
When your app’s authorization state isn’t determined, calling the
request method from your iOS app causes the system to prompt the user to authorize your app. The alert includes the usage description string you provided in the
NSSiri key of your app’s
Info file. The user can approve or deny your app’s request for authorization, and can change your app’s authorization status later in the Settings app. The system remembers your app’s authorization status so that subsequent calls to the
request method don’t prompt the user again.