Skip to content

Commit f051638

Browse files
committed
Add setup-ios-permissions command
1 parent 0ccfb96 commit f051638

File tree

8 files changed

+148
-137
lines changed

8 files changed

+148
-137
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ example/
44
fetchWindowsCapabilites.js
55
mock.js
66
node_modules
7+
react-native.config.js

example/ios/Podfile

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,6 @@ target 'RNPermissionsExample' do
4040
:app_path => "#{Pod::Config.instance.installation_root}/.."
4141
)
4242

43-
permissions_path = '../node_modules/react-native-permissions/ios'
44-
45-
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
46-
pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
47-
pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
48-
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
49-
pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
50-
pod 'Permission-FaceID', :path => "#{permissions_path}/FaceID"
51-
pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
52-
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
53-
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
54-
pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
55-
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
56-
pod 'Permission-Motion', :path => "#{permissions_path}/Motion"
57-
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
58-
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
59-
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
60-
pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"
61-
# pod 'Permission-Siri', :path => "#{permissions_path}/Siri"
62-
pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
63-
pod 'Permission-StoreKit', :path => "#{permissions_path}/StoreKit"
64-
6543
post_install do |installer|
6644
react_native_post_install(installer)
6745
__apply_Xcode_12_5_M1_post_install_workaround(installer)

example/ios/Podfile.lock

Lines changed: 3 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -75,42 +75,6 @@ PODS:
7575
- glog (0.3.5)
7676
- libevent (2.1.12)
7777
- OpenSSL-Universal (1.1.1100)
78-
- Permission-AppTrackingTransparency (3.6.0):
79-
- RNPermissions
80-
- Permission-BluetoothPeripheral (3.6.0):
81-
- RNPermissions
82-
- Permission-Calendars (3.6.0):
83-
- RNPermissions
84-
- Permission-Camera (3.6.0):
85-
- RNPermissions
86-
- Permission-Contacts (3.6.0):
87-
- RNPermissions
88-
- Permission-FaceID (3.6.0):
89-
- RNPermissions
90-
- Permission-LocationAccuracy (3.6.0):
91-
- RNPermissions
92-
- Permission-LocationAlways (3.6.0):
93-
- RNPermissions
94-
- Permission-LocationWhenInUse (3.6.0):
95-
- RNPermissions
96-
- Permission-MediaLibrary (3.6.0):
97-
- RNPermissions
98-
- Permission-Microphone (3.6.0):
99-
- RNPermissions
100-
- Permission-Motion (3.6.0):
101-
- RNPermissions
102-
- Permission-Notifications (3.6.0):
103-
- RNPermissions
104-
- Permission-PhotoLibrary (3.6.0):
105-
- RNPermissions
106-
- Permission-PhotoLibraryAddOnly (3.6.0):
107-
- RNPermissions
108-
- Permission-Reminders (3.6.0):
109-
- RNPermissions
110-
- Permission-SpeechRecognition (3.6.0):
111-
- RNPermissions
112-
- Permission-StoreKit (3.6.0):
113-
- RNPermissions
11478
- RCT-Folly (2021.06.28.00-v2):
11579
- boost
11680
- DoubleConversion
@@ -386,7 +350,7 @@ PODS:
386350
- React-jsi (= 0.69.2)
387351
- React-logger (= 0.69.2)
388352
- React-perflogger (= 0.69.2)
389-
- RNPermissions (3.6.0):
353+
- RNPermissions (3.6.1):
390354
- React-Core
391355
- RNVectorIcons (9.2.0):
392356
- React-Core
@@ -423,24 +387,6 @@ DEPENDENCIES:
423387
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
424388
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
425389
- OpenSSL-Universal (= 1.1.1100)
426-
- Permission-AppTrackingTransparency (from `../node_modules/react-native-permissions/ios/AppTrackingTransparency`)
427-
- Permission-BluetoothPeripheral (from `../node_modules/react-native-permissions/ios/BluetoothPeripheral`)
428-
- Permission-Calendars (from `../node_modules/react-native-permissions/ios/Calendars`)
429-
- Permission-Camera (from `../node_modules/react-native-permissions/ios/Camera`)
430-
- Permission-Contacts (from `../node_modules/react-native-permissions/ios/Contacts`)
431-
- Permission-FaceID (from `../node_modules/react-native-permissions/ios/FaceID`)
432-
- Permission-LocationAccuracy (from `../node_modules/react-native-permissions/ios/LocationAccuracy`)
433-
- Permission-LocationAlways (from `../node_modules/react-native-permissions/ios/LocationAlways`)
434-
- Permission-LocationWhenInUse (from `../node_modules/react-native-permissions/ios/LocationWhenInUse`)
435-
- Permission-MediaLibrary (from `../node_modules/react-native-permissions/ios/MediaLibrary`)
436-
- Permission-Microphone (from `../node_modules/react-native-permissions/ios/Microphone`)
437-
- Permission-Motion (from `../node_modules/react-native-permissions/ios/Motion`)
438-
- Permission-Notifications (from `../node_modules/react-native-permissions/ios/Notifications`)
439-
- Permission-PhotoLibrary (from `../node_modules/react-native-permissions/ios/PhotoLibrary`)
440-
- Permission-PhotoLibraryAddOnly (from `../node_modules/react-native-permissions/ios/PhotoLibraryAddOnly`)
441-
- Permission-Reminders (from `../node_modules/react-native-permissions/ios/Reminders`)
442-
- Permission-SpeechRecognition (from `../node_modules/react-native-permissions/ios/SpeechRecognition`)
443-
- Permission-StoreKit (from `../node_modules/react-native-permissions/ios/StoreKit`)
444390
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
445391
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
446392
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
@@ -502,42 +448,6 @@ EXTERNAL SOURCES:
502448
:path: "../node_modules/react-native/React/FBReactNativeSpec"
503449
glog:
504450
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
505-
Permission-AppTrackingTransparency:
506-
:path: "../node_modules/react-native-permissions/ios/AppTrackingTransparency"
507-
Permission-BluetoothPeripheral:
508-
:path: "../node_modules/react-native-permissions/ios/BluetoothPeripheral"
509-
Permission-Calendars:
510-
:path: "../node_modules/react-native-permissions/ios/Calendars"
511-
Permission-Camera:
512-
:path: "../node_modules/react-native-permissions/ios/Camera"
513-
Permission-Contacts:
514-
:path: "../node_modules/react-native-permissions/ios/Contacts"
515-
Permission-FaceID:
516-
:path: "../node_modules/react-native-permissions/ios/FaceID"
517-
Permission-LocationAccuracy:
518-
:path: "../node_modules/react-native-permissions/ios/LocationAccuracy"
519-
Permission-LocationAlways:
520-
:path: "../node_modules/react-native-permissions/ios/LocationAlways"
521-
Permission-LocationWhenInUse:
522-
:path: "../node_modules/react-native-permissions/ios/LocationWhenInUse"
523-
Permission-MediaLibrary:
524-
:path: "../node_modules/react-native-permissions/ios/MediaLibrary"
525-
Permission-Microphone:
526-
:path: "../node_modules/react-native-permissions/ios/Microphone"
527-
Permission-Motion:
528-
:path: "../node_modules/react-native-permissions/ios/Motion"
529-
Permission-Notifications:
530-
:path: "../node_modules/react-native-permissions/ios/Notifications"
531-
Permission-PhotoLibrary:
532-
:path: "../node_modules/react-native-permissions/ios/PhotoLibrary"
533-
Permission-PhotoLibraryAddOnly:
534-
:path: "../node_modules/react-native-permissions/ios/PhotoLibraryAddOnly"
535-
Permission-Reminders:
536-
:path: "../node_modules/react-native-permissions/ios/Reminders"
537-
Permission-SpeechRecognition:
538-
:path: "../node_modules/react-native-permissions/ios/SpeechRecognition"
539-
Permission-StoreKit:
540-
:path: "../node_modules/react-native-permissions/ios/StoreKit"
541451
RCT-Folly:
542452
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
543453
RCTRequired:
@@ -616,24 +526,6 @@ SPEC CHECKSUMS:
616526
glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
617527
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
618528
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
619-
Permission-AppTrackingTransparency: e7db3d7a30b90efc97fd9008873f03432b09f1a7
620-
Permission-BluetoothPeripheral: 2a5154a9dfdb1cfcf1d546650ced9671904a02af
621-
Permission-Calendars: 59dd823e97ef3c7af911829e849d772a422d10fe
622-
Permission-Camera: 0a0fb4341f50ab242f496fb2f73380e0ec454fe7
623-
Permission-Contacts: 977e7925cb073e7c794c9960d255c362674fe3fe
624-
Permission-FaceID: aaf43b353c25aaa2c1a501f93fa33dcb0f76e6c8
625-
Permission-LocationAccuracy: 13cbce13607e0738f1339447b4c5f51aa2c2b597
626-
Permission-LocationAlways: 6b9874937f2092664dd71fbc53a10f7f0adfff51
627-
Permission-LocationWhenInUse: 51aa065819cd582517e98e89b564e2465a4a83c6
628-
Permission-MediaLibrary: ed0054dbd841f3ed5a2debb4eda9ebe069b43cc1
629-
Permission-Microphone: 84bf2faad8d87969e8e275e9917a174424f948fc
630-
Permission-Motion: d4ce7c0965a69561a64e62a4b7753eb330f2fbaa
631-
Permission-Notifications: 7f2a467ab97a130a847519705340830d52cfc5f0
632-
Permission-PhotoLibrary: fda0fda455bebaa2602f3dfdf8296b28247c1484
633-
Permission-PhotoLibraryAddOnly: e5ae346a7ad3effb3f4da07220cf487ff6a2bcba
634-
Permission-Reminders: a3fcab2ec6a29e85ef78531a0c57efead787cb02
635-
Permission-SpeechRecognition: 1b10d17b12fba5f6c2bd9f19252edd93dbb1f8bc
636-
Permission-StoreKit: dae9818200552af8325e61a774f0de11989cdd0d
637529
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
638530
RCTRequired: b723d4d6da2795df58189a01f92856b6912cf256
639531
RCTTypeSafety: 3973d2fcf39f43f7819e840d56ea6b2fe45996a0
@@ -660,12 +552,12 @@ SPEC CHECKSUMS:
660552
React-RCTVibration: 0d07f00705b5f11e88aaaaf9131f5e1785d4bd6e
661553
React-runtimeexecutor: 8030b9cf9b9e87b878d92da680b55b5e74c58e70
662554
ReactCommon: a9414b91f0d19de002b55d9f4f6cb176d6dd8452
663-
RNPermissions: de7b7c3fe1680d974ac7a85e3e97aa539c0e68ea
555+
RNPermissions: 8fe40a77a65c55cdfedfd5f599ae70e7d48a4363
664556
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
665557
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
666558
Yoga: 236056dd74cda4d9d76c20306fd8c20bb087614d
667559
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
668560

669-
PODFILE CHECKSUM: 11e5343168a844796158fe38474585fbb28294e5
561+
PODFILE CHECKSUM: 61b448d39798006761678f2421f52d0e455a605f
670562

671563
COCOAPODS: 1.11.3

example/package.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"clean-modules": "rm -rf ./node_modules/react-native-permissions/{example,node_modules}",
88
"clean": "rm -rf ./node_modules ./ios/Pods",
99
"preinstall": "cd .. && yarn prepack && cd example",
10-
"postinstall": "yarn clean-modules && yarn pod-update",
11-
"pod-update": "cd ./ios && pod update && cd ..",
10+
"postinstall": "yarn clean-modules && react-native setup-ios-permissions && pod-install",
1211
"start": "react-native start",
1312
"reinstall": "yarn clean && yarn install",
1413
"test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.windows.js"
@@ -24,6 +23,26 @@
2423
"node"
2524
]
2625
},
26+
"iosPermissions": [
27+
"AppTrackingTransparency",
28+
"BluetoothPeripheral",
29+
"Calendars",
30+
"Camera",
31+
"Contacts",
32+
"FaceID",
33+
"LocationAccuracy",
34+
"LocationAlways",
35+
"LocationWhenInUse",
36+
"MediaLibrary",
37+
"Microphone",
38+
"Motion",
39+
"Notifications",
40+
"PhotoLibrary",
41+
"PhotoLibraryAddOnly",
42+
"Reminders",
43+
"SpeechRecognition",
44+
"StoreKit"
45+
],
2746
"dependencies": {
2847
"react": "18.0.0",
2948
"react-native": "0.69.2",
@@ -43,6 +62,7 @@
4362
"babel-jest": "28.1.3",
4463
"jest": "28.1.3",
4564
"metro-react-native-babel-preset": "^0.70.3",
65+
"pod-install": "0.1.38",
4666
"react-test-renderer": "18.0.0",
4767
"selenium-appium": "1.0.2",
4868
"selenium-webdriver": "4.3.1",

example/yarn.lock

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4250,6 +4250,16 @@ cosmiconfig@^5.0.5, cosmiconfig@^5.1.0:
42504250
js-yaml "^3.13.1"
42514251
parse-json "^4.0.0"
42524252

4253+
cosmiconfig@^8.0.0:
4254+
version "8.0.0"
4255+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97"
4256+
integrity sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==
4257+
dependencies:
4258+
import-fresh "^3.2.1"
4259+
js-yaml "^4.1.0"
4260+
parse-json "^5.0.0"
4261+
path-type "^4.0.0"
4262+
42534263
crc-32@^1.2.0:
42544264
version "1.2.2"
42554265
resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff"
@@ -5612,6 +5622,14 @@ import-fresh@^2.0.0:
56125622
caller-path "^2.0.0"
56135623
resolve-from "^3.0.0"
56145624

5625+
import-fresh@^3.2.1:
5626+
version "3.3.0"
5627+
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
5628+
integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
5629+
dependencies:
5630+
parent-module "^1.0.0"
5631+
resolve-from "^4.0.0"
5632+
56155633
import-local@^3.0.2:
56165634
version "3.1.0"
56175635
resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4"
@@ -6441,6 +6459,13 @@ js-yaml@^3.13.1:
64416459
argparse "^1.0.7"
64426460
esprima "^4.0.0"
64436461

6462+
js-yaml@^4.1.0:
6463+
version "4.1.0"
6464+
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
6465+
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
6466+
dependencies:
6467+
argparse "^2.0.1"
6468+
64446469
js2xmlparser2@^0.2.0, js2xmlparser2@^0.x:
64456470
version "0.2.0"
64466471
resolved "https://registry.yarnpkg.com/js2xmlparser2/-/js2xmlparser2-0.2.0.tgz#a7ca2089b83d02331d631892dd6743864125033f"
@@ -7821,6 +7846,13 @@ pako@^1.0.5, pako@~1.0.2:
78217846
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
78227847
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
78237848

7849+
parent-module@^1.0.0:
7850+
version "1.0.1"
7851+
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
7852+
integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
7853+
dependencies:
7854+
callsites "^3.0.0"
7855+
78247856
parse-bmfont-ascii@^1.0.3:
78257857
version "1.0.6"
78267858
resolved "https://registry.yarnpkg.com/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz#11ac3c3ff58f7c2020ab22769079108d4dfa0285"
@@ -7852,7 +7884,7 @@ parse-json@^4.0.0:
78527884
error-ex "^1.3.1"
78537885
json-parse-better-errors "^1.0.1"
78547886

7855-
parse-json@^5.2.0:
7887+
parse-json@^5.0.0, parse-json@^5.2.0:
78567888
version "5.2.0"
78577889
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"
78587890
integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
@@ -8023,6 +8055,11 @@ pngjs@^6.0.0:
80238055
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821"
80248056
integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==
80258057

8058+
8059+
version "0.1.38"
8060+
resolved "https://registry.yarnpkg.com/pod-install/-/pod-install-0.1.38.tgz#1c16a800a5fc1abea0cafcc0e190f376368c76ab"
8061+
integrity sha512-NeDWGigjJRriOIKBOvpW2/tK2tYLfyUT7ia6C6L+oarCAhBNP+IGODWdU+GEAqvfsseqOApcFclpXAJTL0UPzA==
8062+
80268063
portfinder@^1.0.13, portfinder@^1.0.6:
80278064
version "1.0.28"
80288065
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
@@ -8243,7 +8280,10 @@ [email protected]:
82438280
react-native-iphone-x-helper "^1.3.1"
82448281

82458282
react-native-permissions@../:
8246-
version "3.6.0"
8283+
version "3.6.1"
8284+
dependencies:
8285+
cosmiconfig "^8.0.0"
8286+
picocolors "^1.0.0"
82478287

82488288
82498289
version "9.2.0"
@@ -8573,6 +8613,11 @@ resolve-from@^3.0.0:
85738613
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
85748614
integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==
85758615

8616+
resolve-from@^4.0.0:
8617+
version "4.0.0"
8618+
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
8619+
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
8620+
85768621
resolve-from@^5.0.0:
85778622
version "5.0.0"
85788623
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"optional": true
6060
}
6161
},
62+
"dependencies": {
63+
"cosmiconfig": "^8.0.0",
64+
"picocolors": "^1.0.0"
65+
},
6266
"devDependencies": {
6367
"@types/react-native": "^0.69.3",
6468
"@typescript-eslint/eslint-plugin": "^5.30.7",

0 commit comments

Comments
 (0)