Skip to content

Commit 515436a

Browse files
authored
Add 'react-native-image-picker' (zulip#1375)
1 parent e6c7d11 commit 515436a

File tree

9 files changed

+41
-4
lines changed

9 files changed

+41
-4
lines changed

android/app/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ repositories {
159159

160160

161161
dependencies {
162+
compile project(':react-native-notifications')
163+
compile project(':react-native-image-picker')
162164
compile project(':react-native-orientation')
163165
compile project(':react-native-sentry')
164166
compile project(':@remobile/react-native-toast')

android/app/src/main/AndroidManifest.xml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
tools:remove="${excludeSystemAlertWindowPermission}"/>
1111
<uses-permission android:name="android.permission.READ_PHONE_STATE"
1212
tools:node="remove"/>
13+
<uses-permission android:name="android.permission.CAMERA" />
14+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1315

1416
<application
1517
android:name=".MainApplication"

android/app/src/main/java/com/zulipmobile/MainApplication.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
import com.RNFetchBlob.RNFetchBlobPackage;
1010
import com.facebook.react.ReactApplication;
11-
import com.github.yamill.orientation.OrientationPackage;
1211
import com.wix.reactnativenotifications.RNNotificationsPackage;
12+
import com.imagepicker.ImagePickerPackage;
13+
import com.github.yamill.orientation.OrientationPackage;
1314
import com.facebook.react.ReactNativeHost;
1415
import com.facebook.react.ReactPackage;
1516
import com.facebook.react.shell.MainReactPackage;
@@ -50,6 +51,8 @@ public boolean getUseDeveloperSupport() {
5051
protected List<ReactPackage> getPackages() {
5152
return Arrays.<ReactPackage>asList(
5253
new MainReactPackage(),
54+
new RNNotificationsPackage(),
55+
new ImagePickerPackage(),
5356
new OrientationPackage(),
5457
new RNSentryPackage(MainApplication.this),
5558
new PhotoViewPackage(),

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
8+
classpath 'com.android.tools.build:gradle:2.2.+'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

android/settings.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
rootProject.name = 'ZulipMobile'
2+
include ':react-native-notifications'
3+
project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/android')
4+
include ':react-native-image-picker'
5+
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
26
include ':react-native-orientation'
37
project(':react-native-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
48
include ':react-native-sentry'

ios/ZulipMobile.xcodeproj/project.pbxproj

+19
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
DBC5C3186FE64F94BD3CDC19 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A2070A88714C43ED8AF708C3 /* MaterialCommunityIcons.ttf */; };
5757
FF359794CBFF4ABF92423426 /* libRCTToast.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CFB39BBD9094475BB03A3E4 /* libRCTToast.a */; };
5858
C9F58827F1CF47999850925A /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5597847AA2A04FEE894C9C9E /* libRCTOrientation.a */; };
59+
757248247DDE47D3A310353E /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 875BCBF7DC0645ACBA61563B /* libRNImagePicker.a */; };
5960
/* End PBXBuildFile section */
6061

6162
/* Begin PBXContainerItemProxy section */
@@ -429,6 +430,8 @@
429430
FC7EC6A752C243FB9F1B8442 /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFetchBlob.xcodeproj; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = "<group>"; };
430431
713A523038564C27B0D2C2F7 /* RCTOrientation.xcodeproj */ = {isa = PBXFileReference; name = "RCTOrientation.xcodeproj"; path = "../node_modules/react-native-orientation/iOS/RCTOrientation.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
431432
5597847AA2A04FEE894C9C9E /* libRCTOrientation.a */ = {isa = PBXFileReference; name = "libRCTOrientation.a"; path = "libRCTOrientation.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
433+
CFBB80590829494E985F601B /* RNImagePicker.xcodeproj */ = {isa = PBXFileReference; name = "RNImagePicker.xcodeproj"; path = "../node_modules/react-native-image-picker/ios/RNImagePicker.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
434+
875BCBF7DC0645ACBA61563B /* libRNImagePicker.a */ = {isa = PBXFileReference; name = "libRNImagePicker.a"; path = "libRNImagePicker.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
432435
/* End PBXFileReference section */
433436

434437
/* Begin PBXFrameworksBuildPhase section */
@@ -470,6 +473,7 @@
470473
4CD3C48024294A3A816F4CA9 /* libRNPhotoView.a in Frameworks */,
471474
C866080E83494D1C8B535591 /* libRNSafeArea.a in Frameworks */,
472475
C9F58827F1CF47999850925A /* libRCTOrientation.a in Frameworks */,
476+
757248247DDE47D3A310353E /* libRNImagePicker.a in Frameworks */,
473477
);
474478
runOnlyForDeploymentPostprocessing = 0;
475479
};
@@ -683,6 +687,7 @@
683687
06D71A26F8704D96B8C2D342 /* RNPhotoView.xcodeproj */,
684688
8B355454DEEB4F28A5B4F8CA /* RNSafeArea.xcodeproj */,
685689
713A523038564C27B0D2C2F7 /* RCTOrientation.xcodeproj */,
690+
CFBB80590829494E985F601B /* RNImagePicker.xcodeproj */,
686691
);
687692
name = Libraries;
688693
sourceTree = "<group>";
@@ -820,6 +825,14 @@
820825
name = Resources;
821826
sourceTree = "<group>";
822827
};
828+
32268A6D8E1742AE9C2D77A9 /* Frameworks */ = {
829+
isa = PBXGroup;
830+
children = (
831+
);
832+
name = Frameworks;
833+
path = Application;
834+
sourceTree = "<group>";
835+
};
823836
/* End PBXGroup section */
824837

825838
/* Begin PBXNativeTarget section */
@@ -1437,6 +1450,7 @@
14371450
"$(SRCROOT)/../node_modules/react-native-photo-view/ios/**",
14381451
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
14391452
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
1453+
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
14401454
);
14411455
INFOPLIST_FILE = ZulipMobileTests/Info.plist;
14421456
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
@@ -1456,6 +1470,7 @@
14561470
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14571471
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14581472
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1473+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14591474
);
14601475
OTHER_LDFLAGS = (
14611476
"$(inherited)",
@@ -1486,6 +1501,7 @@
14861501
"$(SRCROOT)/../node_modules/react-native-photo-view/ios/**",
14871502
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
14881503
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
1504+
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
14891505
);
14901506
INFOPLIST_FILE = ZulipMobileTests/Info.plist;
14911507
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
@@ -1505,6 +1521,7 @@
15051521
"\"$(SRCROOT)/$(TARGET_NAME)\"",
15061522
"\"$(SRCROOT)/$(TARGET_NAME)\"",
15071523
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1524+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
15081525
);
15091526
OTHER_LDFLAGS = (
15101527
"$(inherited)",
@@ -1540,6 +1557,7 @@
15401557
"$(SRCROOT)/../node_modules/react-native-photo-view/ios/**",
15411558
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
15421559
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
1560+
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
15431561
);
15441562
INFOPLIST_FILE = ZulipMobile/Info.plist;
15451563
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -1580,6 +1598,7 @@
15801598
"$(SRCROOT)/../node_modules/react-native-photo-view/ios/**",
15811599
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
15821600
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
1601+
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
15831602
);
15841603
INFOPLIST_FILE = ZulipMobile/Info.plist;
15851604
IPHONEOS_DEPLOYMENT_TARGET = 8.0;

ios/ZulipMobile/Info.plist

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
</dict>
4949
</dict>
5050
</dict>
51+
<key>NSCameraUsageDescription</key>
52+
<string>Take a photo and upload it to a Zulip realm</string>
5153
<key>NSLocationWhenInUseUsageDescription</key>
52-
<string></string>
54+
<string></string>
5355
<key>NSPhotoLibraryUsageDescription</key>
54-
<string>This app requires access to the photo library.</string>
56+
<string>Upload photos to a Zulip realm</string>
5557
<key>UIAppFonts</key>
5658
<array>
5759
<string>Entypo.ttf</string>

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"react-native": "^0.49.5",
4949
"react-native-device-info": "^0.12.1",
5050
"react-native-fetch-blob": "^0.10.8",
51+
"react-native-image-picker": "^0.26.7",
5152
"react-native-notifications": "^1.1.17",
5253
"react-native-orientation": "^3.1.0",
5354
"react-native-photo-view": "^1.5.2",

yarn.lock

+4
Original file line numberDiff line numberDiff line change
@@ -4915,6 +4915,10 @@ react-native-fetch-blob@^0.10.8:
49154915
base-64 "0.1.0"
49164916
glob "7.0.6"
49174917

4918+
react-native-image-picker@^0.26.7:
4919+
version "0.26.7"
4920+
resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-0.26.7.tgz#ad2ee957f7f6cc01396893ea03d84cb2adb2e376"
4921+
49184922
react-native-notifications@^1.1.17:
49194923
version "1.1.17"
49204924
resolved "https://registry.yarnpkg.com/react-native-notifications/-/react-native-notifications-1.1.17.tgz#a61f3e7f9a36143d5694c734291b2d19a910638f"

0 commit comments

Comments
 (0)