Skip to content

Commit

Permalink
feat(rn): add image picker module
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Sep 28, 2018
1 parent 1c4918f commit e636fb0
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 5 deletions.
1 change: 0 additions & 1 deletion client/react-native/common/components/Library/index.js
Expand Up @@ -9,5 +9,4 @@ export Flex from './Flex'
export Separator from './Separator'
export Button from './Button'
export CustomTextInput from './CustomTextInput.js'
export Image from './Image'
export Badge from './Badge'
1 change: 1 addition & 0 deletions client/react-native/mobile/android/app/build.gradle
Expand Up @@ -141,6 +141,7 @@ android {
}

dependencies {
api project(':react-native-image-picker')
api project(':react-native-network-info')
api project(':react-native-vector-icons')
api fileTree(dir: "libs", include: ["*.jar"])
Expand Down
Expand Up @@ -4,6 +4,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:name=".MainApplication"
Expand Down
Expand Up @@ -5,6 +5,7 @@
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.pusherman.networkinfo.RNNetworkInfoPackage;
import com.imagepicker.ImagePickerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
Expand All @@ -29,7 +30,8 @@ protected List<ReactPackage> getPackages() {
new MainReactPackage(),
new CorePackage(),
new VectorIconsPackage(),
new RNNetworkInfoPackage()
new RNNetworkInfoPackage(),
new ImagePickerPackage()
);
}

Expand Down
4 changes: 3 additions & 1 deletion client/react-native/mobile/android/settings.gradle
Expand Up @@ -3,6 +3,8 @@ rootProject.name = 'berty'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-network-info'
project(':react-native-network-info').projectDir = new File(settingsDir, '../node_modules/react-native-network-info/android')
project(':react-native-network-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-network-info/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')

include ':app'
30 changes: 30 additions & 0 deletions client/react-native/mobile/ios/berty.xcodeproj/project.pbxproj
Expand Up @@ -51,6 +51,7 @@
D1F574B813194C638DBB8677 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1B56A66221FD44708D3DF553 /* EvilIcons.ttf */; };
D2C37F48A843479C88E01010 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DD138C911CB146FD8E521DC7 /* Ionicons.ttf */; };
F18833A248144C8FBB4B7EA0 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F4414BBA1619425594FBE61D /* FontAwesome5_Solid.ttf */; };
F81633C3215E66D000425F92 /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F81633C1215E66A300425F92 /* libRNImagePicker.a */; };
F8799D7A2136F44B003B9FD7 /* CoreModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F8799D752136F3C5003B9FD7 /* CoreModule.m */; };
F8799D7B2136F44E003B9FD7 /* CoreModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8799D782136F3EA003B9FD7 /* CoreModule.swift */; };
F8799E3121395847003B9FD7 /* libRNNetworkInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8799E2F21395818003B9FD7 /* libRNNetworkInfo.a */; };
Expand Down Expand Up @@ -333,6 +334,13 @@
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
remoteInfo = RCTBlob;
};
F81633C0215E66A300425F92 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F81633BC215E66A200425F92 /* RNImagePicker.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 014A3B5C1C6CF33500B6D375;
remoteInfo = RNImagePicker;
};
F8799E2E21395818003B9FD7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8799E0521395818003B9FD7 /* RNNetworkInfo.xcodeproj */;
Expand Down Expand Up @@ -390,6 +398,7 @@
DD138C911CB146FD8E521DC7 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = "<group>"; };
F4414BBA1619425594FBE61D /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = "<group>"; };
F667511A0660437B8CFB10EA /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; };
F81633BC215E66A200425F92 /* RNImagePicker.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNImagePicker.xcodeproj; path = "../../node_modules/react-native-image-picker/ios/RNImagePicker.xcodeproj"; sourceTree = "<group>"; };
F8799D752136F3C5003B9FD7 /* CoreModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreModule.m; sourceTree = "<group>"; };
F8799D772136F3EA003B9FD7 /* berty-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "berty-Bridging-Header.h"; sourceTree = "<group>"; };
F8799D782136F3EA003B9FD7 /* CoreModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreModule.swift; sourceTree = "<group>"; };
Expand All @@ -412,6 +421,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F81633C3215E66D000425F92 /* libRNImagePicker.a in Frameworks */,
F8799E3121395847003B9FD7 /* libRNNetworkInfo.a in Frameworks */,
F8EF7F802136A5AA00FDCCB5 /* libcrypto.a in Frameworks */,
F8EF7F7E2136A27E00FDCCB5 /* libssl.a in Frameworks */,
Expand Down Expand Up @@ -561,6 +571,7 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
F81633BC215E66A200425F92 /* RNImagePicker.xcodeproj */,
F8EF7F7F2136A5AA00FDCCB5 /* libcrypto.a */,
F8EF7F7D2136A27E00FDCCB5 /* libssl.a */,
F8EF7F472136A10500FDCCB5 /* core.framework */,
Expand Down Expand Up @@ -674,6 +685,14 @@
name = Products;
sourceTree = "<group>";
};
F81633BD215E66A200425F92 /* Products */ = {
isa = PBXGroup;
children = (
F81633C1215E66A300425F92 /* libRNImagePicker.a */,
);
name = Products;
sourceTree = "<group>";
};
F8799D4D2136F37F003B9FD7 /* modules */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -880,6 +899,10 @@
ProductGroup = 146834001AC3E56700842450 /* Products */;
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
},
{
ProductGroup = F81633BD215E66A200425F92 /* Products */;
ProjectRef = F81633BC215E66A200425F92 /* RNImagePicker.xcodeproj */;
},
{
ProductGroup = F8799E0621395818003B9FD7 /* Products */;
ProjectRef = F8799E0521395818003B9FD7 /* RNNetworkInfo.xcodeproj */;
Expand Down Expand Up @@ -1159,6 +1182,13 @@
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F81633C1215E66A300425F92 /* libRNImagePicker.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNImagePicker.a;
remoteRef = F81633C0215E66A300425F92 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8799E2F21395818003B9FD7 /* libRNNetworkInfo.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down
10 changes: 9 additions & 1 deletion client/react-native/mobile/ios/berty/Info.plist
Expand Up @@ -67,6 +67,14 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<false/>
<key>NSPhotoLibraryUsageDescription</key>
<string>Berty would like access to your photo gallery</string>
<key>NSCameraUsageDescription</key>
<string>Berty would like to use your camera</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Berty would like to save photos to your photo gallery</string>
<key>NSMicrophoneUsageDescription</key>
<string>Berty would like to your microphone (for videos)</string>
</dict>
</plist>
3 changes: 2 additions & 1 deletion client/react-native/mobile/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "@berty/mobile",
"version": "0.0.1",
"scripts": {
"postinstall": "mkdir -p node_modules/@berty && yarn link:rn && yarn link:rn-vector-icons && yarn link:rn-net-info && yarn link:berty",
"postinstall": "mkdir -p node_modules/@berty && yarn link:rn && yarn link:rn-vector-icons && yarn link:rn-net-info && yarn link:rn-img-pick && yarn link:berty",
"start": "rm -rf $TMPDIR/metro-* && react-native start --reset-cache --root $PWD/../common",
"android": "react-native run-android --no-packager",
"ios": "react-native run-ios --no-packager --scheme=debug",
Expand All @@ -12,6 +12,7 @@
"link:rn": "ln -fs ../../node_modules/react-native node_modules",
"link:rn-vector-icons": "ln -fs ../../node_modules/react-native-vector-icons node_modules",
"link:rn-net-info": "ln -fs ../../node_modules/react-native-network-info node_modules",
"link:rn-img-pick": "ln -fs ../../node_modules/react-native-image-picker node_modules",
"link:berty": "ln -fs ../../../common node_modules/@berty"
}
}
1 change: 1 addition & 0 deletions client/react-native/package.json
Expand Up @@ -16,6 +16,7 @@
"react-art": "^16.4.2",
"react-dom": "^16.4.2",
"react-native": "^0.55.4",
"react-native-image-picker": "^0.26.10",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-network-info": "^3.2.2",
"react-native-vector-icons": "^5.0.0",
Expand Down
4 changes: 4 additions & 0 deletions client/react-native/yarn.lock
Expand Up @@ -5210,6 +5210,10 @@ react-native-drawer-layout@1.3.2:
dependencies:
react-native-dismiss-keyboard "1.0.0"

react-native-image-picker@^0.26.10:
version "0.26.10"
resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-0.26.10.tgz#0bb9ab928984948c67aee0b9e64216bee007a9fc"

react-native-keyboard-spacer@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/react-native-keyboard-spacer/-/react-native-keyboard-spacer-0.4.1.tgz#46f18a320432098a25ea9fa89f5143dd254d332d"
Expand Down

0 comments on commit e636fb0

Please sign in to comment.