expo

How do I save a picture from expo-image-picker to expo-file-system and then render it?

一世执手 提交于 2020-07-23 06:45:31
问题 I am trying to store selected images within the application, as opposed to in the image roll. Here is what I have tried: await FileSystem.downloadAsync( imageUri, // the image uri from expo-image-picker FileSystem.documentDirectory + `${uuid}-image.jpg` ) .then(({ uri }) => { console.log("Finished downloading to ", uri); }) .catch((error) => { console.error(error); }); I receive the error: Unable to download file: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" I also tried: await

Why GoogleSignIn works on Local Server but doesn't works on my Android? [closed]

久未见 提交于 2020-07-22 06:03:17
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 days ago . Improve this question I made small app with GoogleSignIn (using React-Native, Firebase and Expo). I created my OAuth Client Id for Android (got sha1 using openssl rand -base64 32 | openssl sha1 -c and set package name host.exp.exponent ), then I created my firebase web app: image and follow the

Why GoogleSignIn works on Local Server but doesn't works on my Android? [closed]

最后都变了- 提交于 2020-07-22 06:03:13
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 days ago . Improve this question I made small app with GoogleSignIn (using React-Native, Firebase and Expo). I created my OAuth Client Id for Android (got sha1 using openssl rand -base64 32 | openssl sha1 -c and set package name host.exp.exponent ), then I created my firebase web app: image and follow the

Context API using useContext in React Native is showing a TypeError

亡梦爱人 提交于 2020-07-20 21:02:47
问题 I'm attempting to use the modern Context API within React-Native, but I'm getting the following error: TypeError: TypeError: undefined is not an object (evaluating 'Context._context') my createDataContext.js: import React, { useReducer } from 'react' export default (reducer, actions, defaultValue) => { const Context = React.createContext() const Provider = ({ children }) => { const [state, dispatch] = useReducer(reducer, defaultValue) const boundActions = {} for (let key in actions) {

Context API using useContext in React Native is showing a TypeError

纵饮孤独 提交于 2020-07-20 21:01:40
问题 I'm attempting to use the modern Context API within React-Native, but I'm getting the following error: TypeError: TypeError: undefined is not an object (evaluating 'Context._context') my createDataContext.js: import React, { useReducer } from 'react' export default (reducer, actions, defaultValue) => { const Context = React.createContext() const Provider = ({ children }) => { const [state, dispatch] = useReducer(reducer, defaultValue) const boundActions = {} for (let key in actions) {

How to build Expo APK local

徘徊边缘 提交于 2020-07-17 06:29:07
问题 Is it possible to build the APK of an expo app locally? The doc says: If you haven’t used exp before, the first thing you’ll need to do is login with your Expo account using exp login . I tried exp start , exp build:android but the commands require a login. I don't want to build the APK using expo server. Is there a way to run this build locally? So no login and push of source code required? If not, can I view the whole source code of the generated APK? 回答1: if you want to generate apk eject

Display blob image in react native (Expo)

本秂侑毒 提交于 2020-07-10 09:22:42
问题 I have the following fetch function in my react native project to return a blob image from MS Graph, the return works but i cannot seem to display the blob as an image. //Blob Picture fetch('https://graph.microsoft.com/v1.0/me/photo/$value', { headers: { 'Authorization': "Bearer " + accessToken }, }) .then((response) => { // console.log(response); this.setState({ BlobImage: response}); }) .catch((error) => { console.error(error); }); Then i wish to display the image like so: <Image source={

React-Navigation passing functions to screenProps

会有一股神秘感。 提交于 2020-07-10 08:21:45
问题 I am creating an app using React Native, Expo and React Navigation, and I don't know the correct method for passing props and functions around. I have copied the Expo method for navigators that I will build on, but right now I just have App.js calling the following AppNavigator -> MainSwitchNavigator -> HomeScreen I have then wrapped the main exported App that Expo expects with the Amazon AWS Amplify HOC withAuthenticator. Now I can log in to my app and show hello world securely using Amazon

REACT NATIVE : There is way to identify a device type (smartphone, tablet, laptop)?

[亡魂溺海] 提交于 2020-07-10 08:11:31
问题 There is way to identify a device type (smartphone, tablet, laptop) ? I need to identify a device type as: smartphone, tablet, laptop .. i try to use the "react-native-device-info" api library but dont understand how to identify the 3 specific devices type (smartphone, tablet, laptop) . So how can i do some code that will gives me if its "Handset"=> Smartphone , if its "unknown"=> Laptop/Computer and it will be saved as well in my async-storage. import DeviceInfo from 'react-native-device

How to reduce Android APK size in react-native?

徘徊边缘 提交于 2020-07-06 11:40:10
问题 I am working on react native project , but whenever i am building an Apk file , it give me Apk of 47MB. I tried every documentation which i found useful on google but nothing works for me, Is there any way to reduce my App size below 10MB as the app only contain three or four pages. Any help would be appreciated 回答1: You can try following steps Open up android/app/build.gradle Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode. This reduces