Skip to content

Commit 51e5e40

Browse files
committed
chore(example): setup ios permission
1 parent a557d28 commit 51e5e40

File tree

5 files changed

+51
-12
lines changed

5 files changed

+51
-12
lines changed

example/ios/MusicLibraryExample.xcodeproj/project.pbxproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@
384384
"-DFOLLY_CFG_NO_COROUTINES=1",
385385
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
386386
);
387-
OTHER_LDFLAGS = "$(inherited) ";
387+
OTHER_LDFLAGS = (
388+
"$(inherited)",
389+
" ",
390+
);
388391
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
389392
SDKROOT = iphoneos;
390393
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -454,7 +457,10 @@
454457
"-DFOLLY_CFG_NO_COROUTINES=1",
455458
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
456459
);
457-
OTHER_LDFLAGS = "$(inherited) ";
460+
OTHER_LDFLAGS = (
461+
"$(inherited)",
462+
" ",
463+
);
458464
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
459465
SDKROOT = iphoneos;
460466
SWIFT_COMPILATION_MODE = wholemodule;

example/ios/MusicLibraryExample/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSAppleMusicUsageDescription</key>
6+
<string>We need access to your music library to play songs</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleDisplayName</key>

example/ios/Podfile

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
11
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
22

3-
# Resolve react_native_pods.rb with node to allow for hoisting
4-
require Pod::Executable.execute_command('node', ['-p',
5-
'require.resolve(
6-
"react-native/scripts/react_native_pods.rb",
7-
{paths: [process.argv[1]]},
8-
)', __dir__]).strip
3+
# Transform this into a `node_require` generic function:
4+
def node_require(script)
5+
# Resolve script with node to allow for hoisting
6+
require Pod::Executable.execute_command('node', ['-p',
7+
"require.resolve(
8+
'#{script}',
9+
{paths: [process.argv[1]]},
10+
)", __dir__]).strip
11+
end
12+
13+
# Use it to require both react-native's and this package's scripts:
14+
node_require('react-native/scripts/react_native_pods.rb')
15+
node_require('react-native-permissions/scripts/setup.rb')
916

1017
platform :ios, min_ios_version_supported
1118
prepare_react_native_project!
1219

20+
setup_permissions([
21+
# 'AppTrackingTransparency',
22+
# 'Bluetooth',
23+
# 'Calendars',
24+
# 'CalendarsWriteOnly',
25+
# 'Camera',
26+
# 'Contacts',
27+
# 'FaceID',
28+
# 'LocationAccuracy',
29+
# 'LocationAlways',
30+
# 'LocationWhenInUse',
31+
'MediaLibrary',
32+
# 'Microphone',
33+
# 'Motion',
34+
# 'Notifications',
35+
# 'PhotoLibrary',
36+
# 'PhotoLibraryAddOnly',
37+
# 'Reminders',
38+
# 'Siri',
39+
# 'SpeechRecognition',
40+
# 'StoreKit',
41+
])
42+
1343
linkage = ENV['USE_FRAMEWORKS']
1444
if linkage != nil
1545
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,11 +2245,11 @@ SPEC CHECKSUMS:
22452245
ReactAppDependencyProvider: 04d5eb15eb46be6720e17a4a7fa92940a776e584
22462246
ReactCodegen: c63eda03ba1d94353fb97b031fc84f75a0d125ba
22472247
ReactCommon: 76d2dc87136d0a667678668b86f0fca0c16fdeb0
2248-
RNPermissions: 26b05e98dcc62251839cc966c9a96db97b0a3295
2248+
RNPermissions: 95ecc708cdee784c5a186b1969eb0a7e0758ca5e
22492249
RNScreens: 482e9707f9826230810c92e765751af53826d509
22502250
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
22512251
Yoga: c758bfb934100bb4bf9cbaccb52557cee35e8bdf
22522252

2253-
PODFILE CHECKSUM: e4fbe59fd7783d7c951b46300ab5768b18398931
2253+
PODFILE CHECKSUM: 28b287d1cb02410979b73f3f9db3a1702c00a27b
22542254

2255-
COCOAPODS: 1.15.2
2255+
COCOAPODS: 1.16.2

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"ios": "react-native run-ios",
88
"start": "react-native start",
99
"build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
10-
"build:ios": "react-native build-ios --mode Debug"
10+
"build:ios": "react-native build-ios --mode Debug",
11+
"open:ios": "open ios/MusicLibraryExample.xcworkspace"
1112
},
1213
"dependencies": {
1314
"@react-native-community/slider": "^4.5.7",

0 commit comments

Comments
 (0)