Skip to content

Commit 503174b

Browse files
authored
Merge pull request #171 from sendbird/fix/remove-ios-media-library-permission
fix(CLNP-2732): remove unused ios media library permission
2 parents e0b5c51 + 0a65f4f commit 503174b

File tree

7 files changed

+6
-24
lines changed

7 files changed

+6
-24
lines changed

packages/uikit-react-native/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Add the following permission usage descriptions to your `info.plist` file.
9696
| Key | Type | Value |
9797
| --------------------------------------------------- | ------ | --------------------------------------------------------------- |
9898
| Privacy - Camera Usage Description | string | $(PRODUCT_NAME) would like to use your camera |
99-
| Privacy - Media Library Usage Description | string | $(PRODUCT_NAME) would like access to your photo library |
10099
| Privacy - Photo Library Usage Description | string | $(PRODUCT_NAME) would like access to your photo library |
101100
| Privacy - Photo Library Additions Usage Description | string | $(PRODUCT_NAME) would like to save photos to your photo library |
102101

packages/uikit-react-native/src/platform/createFileService.expo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ const createExpoFileService = ({
3939
return expoPermissionGranted([res]);
4040
}
4141
async hasMediaLibraryPermission(type: 'write' | 'read'): Promise<boolean> {
42-
const perms = (await mediaLibraryModule.getPermissionsAsync(
42+
const perms = (await imagePickerModule.getMediaLibraryPermissionsAsync(
4343
type === 'write',
4444
)) as ExpoMediaLibraryPermissionResponse;
4545
return expoPermissionGranted([perms]);
4646
}
4747
async requestMediaLibraryPermission(type: 'write' | 'read'): Promise<boolean> {
48-
const perms = (await mediaLibraryModule.requestPermissionsAsync(
48+
const perms = (await imagePickerModule.requestMediaLibraryPermissionsAsync(
4949
type === 'write',
5050
)) as ExpoMediaLibraryPermissionResponse;
5151
return expoPermissionGranted([perms]);

packages/uikit-react-native/src/platform/createFileService.native.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const createNativeFileService = ({
6767
default: [],
6868
});
6969
const mediaLibraryPermissions: Permission[] = Platform.select({
70-
ios: [permissionModule.PERMISSIONS.IOS.MEDIA_LIBRARY, permissionModule.PERMISSIONS.IOS.PHOTO_LIBRARY],
70+
ios: [permissionModule.PERMISSIONS.IOS.PHOTO_LIBRARY, permissionModule.PERMISSIONS.IOS.PHOTO_LIBRARY_ADD_ONLY],
7171
android: getAndroidStoragePermissionsByAPILevel(permissionModule),
7272
default: [],
7373
});
@@ -83,14 +83,6 @@ const createNativeFileService = ({
8383
}
8484
async hasMediaLibraryPermission(): Promise<boolean> {
8585
const status = await permissionModule.checkMultiple(mediaLibraryPermissions);
86-
if (
87-
__DEV__ &&
88-
Platform.OS === 'ios' &&
89-
status['ios.permission.MEDIA_LIBRARY'] === 'unavailable' &&
90-
status['ios.permission.PHOTO_LIBRARY'] === 'granted'
91-
) {
92-
return true;
93-
}
9486
return nativePermissionGranted(status);
9587
}
9688
async requestMediaLibraryPermission(): Promise<boolean> {

sample/ios/Podfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ target 'SendbirdUIKitSample' do
1818
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
1919
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
2020
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
21-
pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
2221
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
2322

2423
# Enables Flipper.
@@ -30,7 +29,7 @@ target 'SendbirdUIKitSample' do
3029
post_install do |installer|
3130
react_native_post_install(installer)
3231
__apply_Xcode_12_5_M1_post_install_workaround(installer)
33-
32+
3433
installer.pods_project.targets.each do |target|
3534
target.build_configurations.each do |config|
3635
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ''

sample/ios/Podfile.lock

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ PODS:
139139
- OpenSSL-Universal (1.1.180)
140140
- Permission-Camera (3.8.0):
141141
- RNPermissions
142-
- Permission-MediaLibrary (3.8.0):
143-
- RNPermissions
144142
- Permission-Microphone (3.8.0):
145143
- RNPermissions
146144
- Permission-PhotoLibrary (3.8.0):
@@ -507,7 +505,6 @@ DEPENDENCIES:
507505
- glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)
508506
- OpenSSL-Universal (= 1.1.180)
509507
- Permission-Camera (from `../../node_modules/react-native-permissions/ios/Camera`)
510-
- Permission-MediaLibrary (from `../../node_modules/react-native-permissions/ios/MediaLibrary`)
511508
- Permission-Microphone (from `../../node_modules/react-native-permissions/ios/Microphone`)
512509
- Permission-PhotoLibrary (from `../../node_modules/react-native-permissions/ios/PhotoLibrary`)
513510
- Permission-PhotoLibraryAddOnly (from `../../node_modules/react-native-permissions/ios/PhotoLibraryAddOnly`)
@@ -604,8 +601,6 @@ EXTERNAL SOURCES:
604601
:podspec: "../../node_modules/react-native/third-party-podspecs/glog.podspec"
605602
Permission-Camera:
606603
:path: "../../node_modules/react-native-permissions/ios/Camera"
607-
Permission-MediaLibrary:
608-
:path: "../../node_modules/react-native-permissions/ios/MediaLibrary"
609604
Permission-Microphone:
610605
:path: "../../node_modules/react-native-permissions/ios/Microphone"
611606
Permission-PhotoLibrary:
@@ -736,7 +731,6 @@ SPEC CHECKSUMS:
736731
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
737732
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
738733
Permission-Camera: e6d142d7d8b714afe0a83e5e6ae17eb949f1e3e9
739-
Permission-MediaLibrary: 6a5888dd77669b568716bea80c21340aaab74c51
740734
Permission-Microphone: 644b1de8bcc2afcaf934e09a22bee507a95796a7
741735
Permission-PhotoLibrary: 31787bbe77d0d3ae6a5267b8435e4a2e9ef78f1d
742736
Permission-PhotoLibraryAddOnly: 16c92ad62b802514f3f788e00b298080be996337
@@ -793,6 +787,6 @@ SPEC CHECKSUMS:
793787
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
794788
ZIPFoundation: b1f0de4eed33e74a676f76e12559ab6b75990197
795789

796-
PODFILE CHECKSUM: 7326d70ef2ded7c9137457434d401f2de40cb420
790+
PODFILE CHECKSUM: e4c7896172c786f630076d08be27f2516caf1825
797791

798792
COCOAPODS: 1.14.2

sample/ios/SendbirdUIKitSample.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
);
346346
runOnlyForDeploymentPostprocessing = 0;
347347
shellPath = /bin/sh;
348-
shellScript = "set -e\nexport NODE_OPTIONS=--openssl-legacy-provider\nexport ENTRY_FILE=$(pwd)/../index.js\nexport NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh\n";
348+
shellScript = "set -e\nexport ENTRY_FILE=$(pwd)/../index.js\nexport NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh\n";
349349
};
350350
0BA84524D24E532E3D2F7E25 /* [CP-User] [RNFB] Core Configuration */ = {
351351
isa = PBXShellScriptBuildPhase;

sample/ios/SendbirdUIKitSample/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
<string>Permission request for Camera usage</string>
1717
<key>NSMicrophoneUsageDescription</key>
1818
<string>Permission request for Microphone usage</string>
19-
<key>NSAppleMusicUsageDescription</key>
20-
<string>Permission request for MediaLibrary usage</string>
2119
<key>NSPhotoLibraryUsageDescription</key>
2220
<string>Permission request for PhotoLibrary usage</string>
2321
<key>NSPhotoLibraryAddUsageDescription</key>

0 commit comments

Comments
 (0)