Browse Source

Add plist / AndroidManifest.xml instructions

Mathieu Acthernoene 5 years ago
parent
commit
1f21c363e9
1 changed files with 82 additions and 3 deletions
  1. 82
    3
      README.md

+ 82
- 3
README.md View File

@@ -27,7 +27,7 @@ $ yarn add react-native-permissions@next
27 27
 
28 28
 ### iOS
29 29
 
30
-By default no permission handler is installed. Add update your Podfile with the ones you want, then run `pod install`.
30
+By default, no permission handler is installed. Update your `Podfile` by choosing the ones you want, then run `pod install`.
31 31
 
32 32
 ```ruby
33 33
 target 'YourAwesomeProject' do
@@ -56,8 +56,87 @@ target 'YourAwesomeProject' do
56 56
 end
57 57
 ```
58 58
 
59
-_⚠️ Don't forget to add permissions to `AndroidManifest.xml` for android and
60
-`Info.plist` for iOS._
59
+Then update your `Info.plist` with wanted permissions usage descriptions.
60
+
61
+```xml
62
+<!-- 🚨 keep only the permissions used in your app! 🚨 -->
63
+
64
+<key>NSAppleMusicUsageDescription</key>
65
+<string>TEXT</string>
66
+<key>NSBluetoothAlwaysUsageDescription</key>
67
+<string>TEXT</string>
68
+<key>NSBluetoothPeripheralUsageDescription</key>
69
+<string>TEXT</string>
70
+<key>NSCalendarsUsageDescription</key>
71
+<string>TEXT</string>
72
+<key>NSCameraUsageDescription</key>
73
+<string>TEXT</string>
74
+<key>NSContactsUsageDescription</key>
75
+<string>TEXT</string>
76
+<key>NSFaceIDUsageDescription</key>
77
+<string>TEXT</string>
78
+<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
79
+<string>TEXT</string>
80
+<key>NSLocationAlwaysUsageDescription</key>
81
+<string>TEXT</string>
82
+<key>NSLocationWhenInUseUsageDescription</key>
83
+<string>TEXT</string>
84
+<key>NSMicrophoneUsageDescription</key>
85
+<string>TEXT</string>
86
+<key>NSMotionUsageDescription</key>
87
+<string>TEXT</string>
88
+<key>NSPhotoLibraryUsageDescription</key>
89
+<string>TEXT</string>
90
+<key>NSRemindersUsageDescription</key>
91
+<string>TEXT</string>
92
+<key>NSSpeechRecognitionUsageDescription</key>
93
+<string>TEXT</string>
94
+```
95
+
96
+### Android
97
+
98
+Add all wanted permissions to your app `android/app/src/main/res/AndroidManifest.xml`.
99
+
100
+```xml
101
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
102
+  package="com.myawesomeapp">
103
+
104
+  <!-- 🚨 keep only the permissions used in your app! 🚨 -->
105
+
106
+  <uses-permission android:name="android.permission.ACCEPT_HANDOVER" />
107
+  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
108
+  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
109
+  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
110
+  <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
111
+  <uses-permission android:name="android.permission.ANSWER_PHONE_CALLS" />
112
+  <uses-permission android:name="android.permission.BODY_SENSORS" />
113
+  <uses-permission android:name="android.permission.CALL_PHONE" />
114
+  <uses-permission android:name="android.permission.CAMERA" />
115
+  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
116
+  <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
117
+  <uses-permission android:name="android.permission.READ_CALENDAR" />
118
+  <uses-permission android:name="android.permission.READ_CALL_LOG" />
119
+  <uses-permission android:name="android.permission.READ_CONTACTS" />
120
+  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
121
+  <uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
122
+  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
123
+  <uses-permission android:name="android.permission.READ_SMS" />
124
+  <uses-permission android:name="android.permission.RECEIVE_MMS" />
125
+  <uses-permission android:name="android.permission.RECEIVE_SMS" />
126
+  <uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
127
+  <uses-permission android:name="android.permission.RECORD_AUDIO" />
128
+  <uses-permission android:name="android.permission.SEND_SMS" />
129
+  <uses-permission android:name="android.permission.USE_SIP" />
130
+  <uses-permission android:name="android.permission.WRITE_CALENDAR" />
131
+  <uses-permission android:name="android.permission.WRITE_CALL_LOG" />
132
+  <uses-permission android:name="android.permission.WRITE_CONTACTS" />
133
+  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
134
+  <uses-permission android:name="com.android.voicemail.permission.ADD_VOICEMAIL" />
135
+
136
+  <!-- … -->
137
+
138
+</manifest>
139
+```
61 140
 
62 141
 ## 🆘 Manual linking
63 142