You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -119,110 +119,6 @@ public class MainApplication extends Application implements ReactApplication {
119
119
120
120
</details>
121
121
122
-
## Permission lifecycles
123
-
124
-
Permission are not handled in the same way on iOS and Android. This library provides an abstraction over the platforms behaviors. To understand it a little better, have a look to these two flowcharts:
125
-
126
-
### iOS
127
-
128
-
```
129
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
130
-
┃ check(PERMISSIONS.IOS.CAMERA) ┃
131
-
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
132
-
│
133
-
Is the feature available
134
-
on this device ?
135
-
│ ╔════╗
136
-
├───────────║ NO ║──────────────┐
137
-
│ ╚════╝ │
138
-
╔═════╗ ▼
139
-
║ YES ║ ┌─────────────────────┐
140
-
╚═════╝ │ RESULTS.UNAVAILABLE │
141
-
│ └─────────────────────┘
142
-
Is the permission
143
-
requestable ?
144
-
│ ╔════╗
145
-
├───────────║ NO ║──────────────┐
146
-
│ ╚════╝ │
147
-
╔═════╗ ▼
148
-
║ YES ║ ┌───────────────────┐
149
-
╚═════╝ │ RESULTS.BLOCKED / │
150
-
│ │ RESULTS.GRANTED │
151
-
▼ └───────────────────┘
152
-
┌────────────────┐
153
-
│ RESULTS.DENIED │
154
-
└────────────────┘
155
-
│
156
-
▼
157
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
158
-
┃ request(PERMISSIONS.IOS.CAMERA) ┃
159
-
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
160
-
│
161
-
Does the user accepted
162
-
the request ?
163
-
│ ╔════╗
164
-
├───────────║ NO ║──────────────┐
165
-
│ ╚════╝ │
166
-
╔═════╗ ▼
167
-
║ YES ║ ┌─────────────────┐
168
-
╚═════╝ │ RESULTS.BLOCKED │
169
-
│ └─────────────────┘
170
-
▼
171
-
┌─────────────────┐
172
-
│ RESULTS.GRANTED │
173
-
└─────────────────┘
174
-
```
175
-
176
-
### Android
177
-
178
-
```
179
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
180
-
┃ check(PERMISSIONS.ANDROID.CAMERA) ┃
181
-
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
182
-
│
183
-
Is the feature available
184
-
on this device ?
185
-
│ ╔════╗
186
-
├───────────║ NO ║──────────────┐
187
-
│ ╚════╝ │
188
-
╔═════╗ ▼
189
-
║ YES ║ ┌─────────────────────┐
190
-
╚═════╝ │ RESULTS.UNAVAILABLE │
191
-
│ └─────────────────────┘
192
-
Is the permission
193
-
requestable ?
194
-
│ ╔════╗
195
-
├───────────║ NO ║──────────────┐
196
-
│ ╚════╝ │
197
-
╔═════╗ ▼
198
-
║ YES ║ ┌───────────────────┐
199
-
╚═════╝ │ RESULTS.BLOCKED / │
200
-
│ │ RESULTS.GRANTED │
201
-
▼ └───────────────────┘
202
-
┌────────────────┐
203
-
│ RESULTS.DENIED │◀──────────────────────┐
204
-
└────────────────┘ │
205
-
│ │
206
-
▼ │
207
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ╔════╗
208
-
┃ request(PERMISSIONS.ANDROID.CAMERA) ┃ ║ NO ║
209
-
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ╚════╝
210
-
│ │
211
-
Does the user accepted │
212
-
the request ? │
213
-
│ ╔════╗ Does the user checked
214
-
├───────────║ NO ║─────"Never ask again" ?
215
-
│ ╚════╝ │
216
-
╔═════╗ ╔═════╗
217
-
║ YES ║ ║ YES ║
218
-
╚═════╝ ╚═════╝
219
-
│ │
220
-
▼ ▼
221
-
┌─────────────────┐ ┌─────────────────┐
222
-
│ RESULTS.GRANTED │ │ RESULTS.BLOCKED │
223
-
└─────────────────┘ └─────────────────┘
224
-
```
225
-
226
122
## API
227
123
228
124
### Permissions statuses
@@ -454,3 +350,107 @@ import {openSettings} from 'react-native-permissions';
454
350
455
351
openSettings().catch(() =>console.warn('cannot open settings'));
456
352
```
353
+
354
+
## Understanding lifecycle
355
+
356
+
As permissions are not handled in the same way on iOS and Android, this library provides an abstraction over the two platforms behaviors. To understand it a little better, have a look to these two flowcharts:
0 commit comments