Skip to content

Commit

Permalink
upgrade rn-camera (attempt to fix #3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasom committed Apr 4, 2018
1 parent 5529772 commit 05d787b
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.facebook.soloader.SoLoader;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import org.reactnative.camera.RNCameraPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.rnfs.RNFSPackage;
import es.tiarg.nfcreactnative.NfcReactNativePackage;
Expand Down Expand Up @@ -65,7 +65,7 @@ protected List<ReactPackage> getPackages() {
new RealmReactPackage(),
new RNI18nPackage(),
new RandomBytesPackage(),
new RCTCameraPackage(),
new RNCameraPackage(),
new RNFSPackage(),
new ReactNativeDialogsPackage(),
new ImageResizerPackage(),
Expand Down
86 changes: 29 additions & 57 deletions ios/StatusIm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
3A8BF31C42291E324219071C /* InstabugCore.framework in Embed Instabug Framework */ = {isa = PBXBuildFile; fileRef = EA36FD18BC2ECACF0A8B83DE /* InstabugCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3E15DFEC1F6F4D7CAE088F49 /* libTcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */; };
4C16DE0C1F89508700AA10DB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */; };
4C8F6CF72074F84200F605CA /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C8F6CF62074F83C00F605CA /* libRNCamera.a */; };
4CA4DA1B206D105D006A98B0 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E3F1C121DDAE781005E4779 /* libRNInstabug.a */; };
4FFAE7B0414A463991039A2E /* libRNRandomBytes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */; };
5974D2035B8B47E0946B63B6 /* libRNFIRMessaging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */; };
Expand All @@ -52,7 +53,6 @@
98482A6F2065257B00263651 /* libReactNativeTestFairy.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9880471C20650CBC00CEBFE0 /* libReactNativeTestFairy.a */; };
9E0B01A11DDC5DA7002B0359 /* SF-UI-Text-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9E0B01A01DDC5DA7002B0359 /* SF-UI-Text-Light.otf */; };
9E3AB6D01D87DB2B008846B4 /* libReact-Native-Webview-Bridge.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E3AB6C61D87DA2B008846B4 /* libReact-Native-Webview-Bridge.a */; };
9E7C64731E03FDDE004C7042 /* libRCTCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20B7D1151D3F74CD00B70F14 /* libRCTCamera.a */; };
9ED2F45E1D9D535A00B36508 /* SF-UI-Text-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9ED2F45D1D9D52DD00B36508 /* SF-UI-Text-Regular.otf */; };
9ED2F45F1D9D535A00B36508 /* SF-UI-Text-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9ED2F45C1D9D52C100B36508 /* SF-UI-Text-Medium.otf */; };
9ED2F4611D9D579900B36508 /* SF-UI-Text-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9ED2F4601D9D577B00B36508 /* SF-UI-Text-Bold.otf */; };
Expand Down Expand Up @@ -174,13 +174,6 @@
remoteGlobalIDString = CDD7BF781B2D5125006FDA75;
remoteInfo = RNI18n;
};
20B7D1141D3F74CD00B70F14 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9F1854E6D9654226B1FC8308 /* RCTCamera.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 4107012F1ACB723B00C6AA39;
remoteInfo = RCTCamera;
};
20B7D1191D3F74CD00B70F14 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 305F194186D848FDB07AF34C /* RNFS.xcodeproj */;
Expand All @@ -195,6 +188,13 @@
remoteGlobalIDString = F60690131CA2766F0003FB26;
remoteInfo = RealmReact;
};
4C8F6CF52074F83C00F605CA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4C8F6CF12074F83C00F605CA /* RNCamera.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 4107012F1ACB723B00C6AA39;
remoteInfo = RNCamera;
};
5537E2A920650E640085CED4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
Expand Down Expand Up @@ -300,13 +300,6 @@
remoteGlobalIDString = 24DF11ED1DA3A2B90056F77C;
remoteInfo = RNInstabug;
};
9EC013781E06FB1900155B5C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 0974579A1D2A440A000D9368;
remoteInfo = RCTWKWebView;
};
9EF083601F3B538B00876A8F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9EF083381F3B538A00876A8F /* ReactNativeConfig.xcodeproj */;
Expand Down Expand Up @@ -566,6 +559,7 @@
45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNRandomBytes.xcodeproj; path = "../node_modules/react-native-randombytes/RNRandomBytes.xcodeproj"; sourceTree = "<group>"; };
46E2F6052EB44C698C680894 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/ios/RNI18n.xcodeproj"; sourceTree = "<group>"; };
4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4C8F6CF12074F83C00F605CA /* RNCamera.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNCamera.xcodeproj; path = "../node_modules/react-native-camera/ios/RNCamera.xcodeproj"; sourceTree = "<group>"; };
4E586E1B0E544F64AA9F5BD1 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
4EC426A98043452BB6F9C134 /* libRNInstabug.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNInstabug.a; sourceTree = "<group>"; };
52F6ED6465184513A082652B /* libRNI18n.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNI18n.a; sourceTree = "<group>"; };
Expand All @@ -588,12 +582,10 @@
9880471720650CBC00CEBFE0 /* ReactNativeTestFairy.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeTestFairy.xcodeproj; path = "../node_modules/react-native-testfairy/ios/ReactNativeTestFairy.xcodeproj"; sourceTree = "<group>"; };
9E0B01A01DDC5DA7002B0359 /* SF-UI-Text-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Light.otf"; sourceTree = "<group>"; };
9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "React-Native-Webview-Bridge.xcodeproj"; path = "../node_modules/react-native-webview-bridge/ios/React-Native-Webview-Bridge.xcodeproj"; sourceTree = "<group>"; };
9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWKWebView.xcodeproj; path = "../node_modules/react-native-wkwebview-reborn/ios/RCTWKWebView.xcodeproj"; sourceTree = "<group>"; };
9ED2F45C1D9D52C100B36508 /* SF-UI-Text-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Medium.otf"; sourceTree = "<group>"; };
9ED2F45D1D9D52DD00B36508 /* SF-UI-Text-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Regular.otf"; sourceTree = "<group>"; };
9ED2F4601D9D577B00B36508 /* SF-UI-Text-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Bold.otf"; sourceTree = "<group>"; };
9EF083381F3B538A00876A8F /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = "<group>"; };
9F1854E6D9654226B1FC8308 /* RCTCamera.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTCamera.xcodeproj; path = "../node_modules/react-native-camera/ios/RCTCamera.xcodeproj"; sourceTree = "<group>"; };
ACA66A8F16CD2FE21F38738B /* Pods-StatusIm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusIm.debug.xcconfig"; path = "Pods/Target Support Files/Pods-StatusIm/Pods-StatusIm.debug.xcconfig"; sourceTree = "<group>"; };
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
AF2BF381BC7B4EB0887F0091 /* libRNSVG.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNSVG.a; sourceTree = "<group>"; };
Expand Down Expand Up @@ -633,6 +625,7 @@
98482A6F2065257B00263651 /* libReactNativeTestFairy.a in Frameworks */,
C93242561FE1C68C00FE7099 /* libRCTAnimation.a in Frameworks */,
4C16DE0C1F89508700AA10DB /* JavaScriptCore.framework in Frameworks */,
4C8F6CF72074F84200F605CA /* libRNCamera.a in Frameworks */,
B2DEA0D01E49E33300FA28D6 /* libRCTHttpServer.a in Frameworks */,
925C1F481F7B73B20063DFA0 /* FirebaseCoreDiagnostics.framework in Frameworks */,
9EE89E271E03FCB7007D3C25 /* libSplashScreen.a in Frameworks */,
Expand All @@ -659,7 +652,6 @@
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
9E7C64731E03FDDE004C7042 /* libRCTCamera.a in Frameworks */,
FD4F213C3873473CB703B1D2 /* libRNFS.a in Frameworks */,
213311F38CA74CE280FD09AD /* libRNI18n.a in Frameworks */,
4FFAE7B0414A463991039A2E /* libRNRandomBytes.a in Frameworks */,
Expand Down Expand Up @@ -863,27 +855,27 @@
name = Products;
sourceTree = "<group>";
};
20B7D1111D3F74CD00B70F14 /* Products */ = {
20B7D1161D3F74CD00B70F14 /* Products */ = {
isa = PBXGroup;
children = (
20B7D1151D3F74CD00B70F14 /* libRCTCamera.a */,
20B7D11A1D3F74CD00B70F14 /* libRNFS.a */,
C900481D1FC47AF50002B8EA /* libRNFS.a */,
);
name = Products;
sourceTree = "<group>";
};
20B7D1161D3F74CD00B70F14 /* Products */ = {
20B7D1251D3F74CD00B70F14 /* Products */ = {
isa = PBXGroup;
children = (
20B7D11A1D3F74CD00B70F14 /* libRNFS.a */,
C900481D1FC47AF50002B8EA /* libRNFS.a */,
20B7D1291D3F74CD00B70F14 /* libRealmReact.a */,
);
name = Products;
sourceTree = "<group>";
};
20B7D1251D3F74CD00B70F14 /* Products */ = {
4C8F6CF22074F83C00F605CA /* Products */ = {
isa = PBXGroup;
children = (
20B7D1291D3F74CD00B70F14 /* libRealmReact.a */,
4C8F6CF62074F83C00F605CA /* libRNCamera.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -911,10 +903,10 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
4C8F6CF12074F83C00F605CA /* RNCamera.xcodeproj */,
9880471720650CBC00CEBFE0 /* ReactNativeTestFairy.xcodeproj */,
9EF083381F3B538A00876A8F /* ReactNativeConfig.xcodeproj */,
B2DEA0A41E49E32000FA28D6 /* RCTHttpServer.xcodeproj */,
9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */,
B2A5F42F1DEC36B200174F4D /* RCTAnimation.xcodeproj */,
3A7EB0491DD9CABC00A4FCC8 /* SplashScreen.xcodeproj */,
20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */,
Expand All @@ -930,7 +922,6 @@
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
9F1854E6D9654226B1FC8308 /* RCTCamera.xcodeproj */,
305F194186D848FDB07AF34C /* RNFS.xcodeproj */,
46E2F6052EB44C698C680894 /* RNI18n.xcodeproj */,
45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */,
Expand Down Expand Up @@ -1024,14 +1015,6 @@
name = Products;
sourceTree = "<group>";
};
9EC0135D1E06FB1900155B5C /* Products */ = {
isa = PBXGroup;
children = (
9EC013791E06FB1900155B5C /* libRCTWKWebView.a */,
);
name = Products;
sourceTree = "<group>";
};
9EF083391F3B538A00876A8F /* Products */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1232,10 +1215,6 @@
ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */;
ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
},
{
ProductGroup = 20B7D1111D3F74CD00B70F14 /* Products */;
ProjectRef = 9F1854E6D9654226B1FC8308 /* RCTCamera.xcodeproj */;
},
{
ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
Expand Down Expand Up @@ -1280,10 +1259,6 @@
ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
},
{
ProductGroup = 9EC0135D1E06FB1900155B5C /* Products */;
ProjectRef = 9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */;
},
{
ProductGroup = 9E3AB6B31D87DA2A008846B4 /* Products */;
ProjectRef = 9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */;
Expand All @@ -1304,6 +1279,10 @@
ProductGroup = 20B7D1251D3F74CD00B70F14 /* Products */;
ProjectRef = F090E261B9854867A728CE4F /* RealmReact.xcodeproj */;
},
{
ProductGroup = 4C8F6CF22074F83C00F605CA /* Products */;
ProjectRef = 4C8F6CF12074F83C00F605CA /* RNCamera.xcodeproj */;
},
{
ProductGroup = 922C4C211F4D5C3F0033C753 /* Products */;
ProjectRef = F89A8F8005874B86B63C22E3 /* RNFIRMessaging.xcodeproj */;
Expand Down Expand Up @@ -1437,13 +1416,6 @@
remoteRef = 20B7D10D1D3F74CD00B70F14 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
20B7D1151D3F74CD00B70F14 /* libRCTCamera.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTCamera.a;
remoteRef = 20B7D1141D3F74CD00B70F14 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
20B7D11A1D3F74CD00B70F14 /* libRNFS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand All @@ -1458,6 +1430,13 @@
remoteRef = 20B7D1281D3F74CD00B70F14 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4C8F6CF62074F83C00F605CA /* libRNCamera.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNCamera.a;
remoteRef = 4C8F6CF52074F83C00F605CA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
5537E2AA20650E640085CED4 /* libjsinspector.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -1563,13 +1542,6 @@
remoteRef = 9E3F1C111DDAE781005E4779 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9EC013791E06FB1900155B5C /* libRCTWKWebView.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTWKWebView.a;
remoteRef = 9EC013781E06FB1900155B5C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9EF083611F3B538B00876A8F /* libReactNativeConfig.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"react-dom": "16.2.0",
"react-native": "0.53.3",
"react-native-background-timer": "2.0.0",
"react-native-camera": "0.10.0",
"react-native-camera": "git+https://github.com/status-im/react-native-camera.git#status-1.0.3",
"react-native-config": "0.9.0",
"react-native-crypto": "2.1.1",
"react-native-dialogs": "0.0.20",
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-osx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ open -a /Applications/Genymotion.app/Contents/MacOS/player.app --args --vm-name
fi

# Install deps, prepare for genymotion and figwheel
lein deps && ./re-natal deps && ./re-natal use-android-device "${device_type}" && ./re-natal use-figwheel
lein deps && npm install && ./re-natal use-android-device "${device_type}" && ./re-natal use-figwheel && npm install

# open figwheel in new tab
tab "lein figwheel-repl ${cljs_build}"
Expand Down
7 changes: 4 additions & 3 deletions src/status_im/ui/components/camera.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
[clojure.walk :as walk]
[status-im.react-native.js-dependencies :as js-dependecies]))

(def rn-camera (.-RNCamera js-dependecies/camera))
(def default-camera (.-default js-dependecies/camera))

(defn constants [t]
(-> js-dependecies/camera
(-> default-camera
(object/get "constants")
(object/get t)
(js->clj)
Expand All @@ -18,15 +19,15 @@
(def torch-modes (constants "TorchMode"))

(defn set-torch [state]
(set! (.-torchMode default-camera) (get torch-modes state)))
(set! (.-torchMode rn-camera) (get torch-modes state)))

(defn request-access-ios [then else]
(-> (.checkVideoAuthorizationStatus default-camera)
(.then then)
(.catch else)))

(defn camera [props]
(reagent/create-element default-camera (clj->js (merge {:inverted true} props))))
(reagent/create-element rn-camera (clj->js (merge {:inverted true} props))))

(defn get-qr-code-data [code]
(.-data code))
Loading

0 comments on commit 05d787b

Please sign in to comment.