Request permissions alert in iOS

Vikas Kore
3 min readMar 18, 2019

--

An iOS app on or after iOS 10.0 must include in its Info.plist file the usage description keys for the types of data it needs to access or use otherwise app will crash. i.e. to access Contacts data specifically, you must include NSContactsUsageDescription.

iOS helps prevent apps from accessing a user’s personal information without permission.

When we open the app for the first time and then come to see couple of user request permissions back to back, we probably going to tap “Don’t Allow.”

Getting access the first time is critical, we have to use right way to ask users for permissions, explain to a user the benefits they’ll receive by giving the app access.

Add these keys and description in plist file

Permission keys in iOS

  1. Privacy — AppleEvents Sending Usage Description
    -An app using Apple events to control another app might be able to gain access to sensitive user data. For example, the Mail app stores a lot of personal information in its local database that other apps can’t access directly. But because Mail can be automated with Apple events, other apps can use Mail to gain access to the data indirectly.
    This key is required if your app uses APIs that send Apple events.

2. Privacy — Bluetooth Peripheral Usage Description

3. Privacy — Calendars Usage Description

4. Privacy — Camera Usage Description

5. Privacy — Contacts Usage Description

6. Privacy — Face ID Usage Description

7. Privacy — Health Records Usage Description

8. Privacy — Health Share Usage Description

9. Privacy — Health Update Usage Description

10. Privacy — HomeKit Usage Description

11. Privacy — Location Always and When In Use Usage Description

12. Privacy — Location Always Usage Description
-The app can access the device’s location either when app is in use or in the background.

13. Privacy — Location Usage Description

14. Privacy — Location When In Use Usage Description
-The app can access the device’s location when the app is in use.

15. Privacy — Media Library Usage Description

16. Privacy — Microphone Usage Description

17. Privacy — Motion Usage Description

18. Privacy — Music Usage Description

19. Privacy — NFC Scan Usage Description
-Near Field Communication (NFC) tag scanning

20. Privacy — Photo Library Additions Usage Description

21. Privacy — Photo Library Usage Description

22. Privacy — Reminders Usage Description

23. Privacy — Siri Usage Description

24. Privacy — Speech Recognition Usage Description

25. Privacy — System Administration Usage Description
-This key is required if your app uses APIs that manipulate the system configuration.

26. Privacy — TV Provider Usage Description

27. Privacy — Video Subscriber Account Usage Description
-This key is required if your app uses APIs that access the user’s TV provider account.

Then it looks like

Some sample values for the above permission

Permission alert title is managed by OS but we have to provide description in request.
I have collected some example messages for us, click on following link to view

please have a look on this also.

Thank you, Happy Coding!

--

--

Vikas Kore
Vikas Kore

No responses yet