Skip to content

Commit 34fa2e0

Browse files
authored
Merge pull request #838 from zoontek/4.1.0
2 parents 2a314f3 + adc348a commit 34fa2e0

File tree

13 files changed

+1005
-772
lines changed

13 files changed

+1005
-772
lines changed

.eslintignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
.eslintrc.js
2+
23
dist/
4+
node_modules
35
example/
46
scripts/
7+
8+
app.plugin.js
59
fetchWindowsCapabilites.js
610
mock.js
7-
node_modules
811
react-native.config.js

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
},
1212

1313
parserOptions: {
14-
project: './tsconfig.json',
14+
project: ['./tsconfig.json', './plugin/tsconfig.json'],
1515
ecmaFeatures: {jsx: true},
1616
ecmaVersion: 2018,
1717
sourceType: 'module',

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ body:
1818
label: Before submitting a new issue
1919
description: Please perform simple checks first.
2020
options:
21-
- label: I tested using the latest release of the library, as maybe the bug has been already fixed.
22-
required: true
23-
- label: I checked for possible duplicate issues, with possible answers.
24-
required: true
21+
- label: I tested using the latest release of the library, as maybe the bug has been already fixed.
22+
required: true
23+
- label: I checked for possible duplicate issues, with possible answers.
24+
required: true
2525
- type: textarea
2626
id: summary
2727
attributes:
@@ -36,7 +36,7 @@ body:
3636
attributes:
3737
label: Library version
3838
description: What version of the library are you using?
39-
placeholder: "x.x.x"
39+
placeholder: 'x.x.x'
4040
validations:
4141
required: true
4242
- type: textarea

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,51 @@ setup_permissions([
9292
#
9393
```
9494

95+
<details>
96+
<summary><b>🧩 For expo users, see the plugin instructions</b></summary>
97+
98+
If you use expo you can use the built-in expo config plugin to perform the work outlined in steps 1 and 2:
99+
100+
```json
101+
{
102+
"name": "My awesome app",
103+
"plugins": [
104+
[
105+
"react-native-permissions",
106+
{
107+
// uncomment wanted permissions
108+
"iosPermissions": [
109+
// "AppTrackingTransparency",
110+
// "Bluetooth"
111+
// "Calendars",
112+
// "CalendarsWriteOnly",
113+
// "Camera",
114+
// "Contacts",
115+
// "FaceID",
116+
// "LocationAccuracy",
117+
// "LocationAlways",
118+
// "LocationWhenInUse",
119+
// "MediaLibrary",
120+
// "Microphone",
121+
// "Motion",
122+
// "Notifications",
123+
// "PhotoLibrary",
124+
// "PhotoLibraryAddOnly",
125+
// "Reminders",
126+
// "Siri",
127+
// "SpeechRecognition",
128+
// "StoreKit"
129+
]
130+
}
131+
]
132+
]
133+
}
134+
```
135+
136+
</details>
137+
95138
3. Then execute `pod install` _(📌  Note that it must be re-executed each time you update this config)_.
139+
96140
4. Finally, update your `Info.plist` with the wanted permissions usage descriptions:
97141

98142
```xml

android/src/main/java/com/zoontek/rnpermissions/RNPermissionsModule.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,11 @@ public boolean onRequestPermissionsResult(int requestCode, String[] permissions,
325325
mCallbacks.get(requestCode).invoke(grantResults, getPermissionAwareActivity());
326326
mCallbacks.remove(requestCode);
327327
return mCallbacks.size() == 0;
328-
} catch (IllegalStateException e) {
329-
FLog.e(
330-
"PermissionsModule",
331-
e,
332-
"Unexpected invocation of `onRequestPermissionsResult` with invalid current activity");
333-
return false;
334-
} catch (NullPointerException e) {
328+
} catch (Exception e) {
335329
FLog.e(
336330
"PermissionsModule",
337331
e,
338-
"Unexpected invocation of `onRequestPermissionsResult` with invalid request code");
332+
"Unexpected invocation of `onRequestPermissionsResult`");
339333
return false;
340334
}
341335
}

app.plugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./dist/commonjs/expo');

example/ios/Podfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ PODS:
6868
- FlipperKit/FlipperKitNetworkPlugin
6969
- fmt (6.2.1)
7070
- glog (0.3.5)
71-
- hermes-engine (0.73.1):
72-
- hermes-engine/Pre-built (= 0.73.1)
73-
- hermes-engine/Pre-built (0.73.1)
71+
- hermes-engine (0.73.2):
72+
- hermes-engine/Pre-built (= 0.73.2)
73+
- hermes-engine/Pre-built (0.73.2)
7474
- libevent (2.1.12)
7575
- OpenSSL-Universal (1.1.1100)
7676
- RCT-Folly (2022.05.16.00):
@@ -1113,7 +1113,7 @@ PODS:
11131113
- React-jsi (= 0.73.2)
11141114
- React-logger (= 0.73.2)
11151115
- React-perflogger (= 0.73.2)
1116-
- RNPermissions (4.0.4):
1116+
- RNPermissions (4.1.0):
11171117
- React-Core
11181118
- RNVectorIcons (10.0.3):
11191119
- glog
@@ -1322,7 +1322,7 @@ EXTERNAL SOURCES:
13221322
:path: "../node_modules/react-native/ReactCommon/yoga"
13231323

13241324
SPEC CHECKSUMS:
1325-
boost: 26fad476bfa736552bbfa698a06cc530475c1505
1325+
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
13261326
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
13271327
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
13281328
FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4
@@ -1337,7 +1337,7 @@ SPEC CHECKSUMS:
13371337
FlipperKit: 37525a5d056ef9b93d1578e04bc3ea1de940094f
13381338
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
13391339
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
1340-
hermes-engine: 34df9d5034e90bd9bf1505e1ca198760373935af
1340+
hermes-engine: b361c9ef5ef3cda53f66e195599b47e1f84ffa35
13411341
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
13421342
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
13431343
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
@@ -1382,7 +1382,7 @@ SPEC CHECKSUMS:
13821382
React-runtimescheduler: df8945a656356ff10f58f65a70820478bfcf33ad
13831383
React-utils: f5bc61e7ea3325c0732ae2d755f4441940163b85
13841384
ReactCommon: 45b5d4f784e869c44a6f5a8fad5b114ca8f78c53
1385-
RNPermissions: 0d8cbc900fafdf0ebb78b1f1f955b582ff0cb282
1385+
RNPermissions: a806c6097cf766fc4053518746e4c7263102784c
13861386
RNVectorIcons: 210f910e834e3485af40693ad4615c1ec22fc02b
13871387
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
13881388
Yoga: 13c8ef87792450193e117976337b8527b49e8c03

example/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"noUnusedParameters": true,
2323

2424
"paths": {
25-
"react-native-permissions": ["../src"]
26-
}
25+
"react-native-permissions": ["../src"],
26+
},
2727
},
2828
"include": ["src"],
29-
"exclude": ["node_modules", "babel.config.js", "metro.config.js"]
29+
"exclude": ["node_modules", "babel.config.js", "metro.config.js"],
3030
}

0 commit comments

Comments
 (0)