React Native [Android] URI from Google Drive w/ 'React-Native-Document-Picker' & 'react-native-get-real-path'
Date : March 29 2020, 07:55 AM
like below fixes the issue Fixed bug to get absolute path of Google Drive File. So it turns out that we cannot directly get the absolute path from the URI that has been returned by selecting Google Drive File. Hence we need to apply some sort of hack to solve the problem. input = context.getContentResolver().openInputStream(uri);
/* save stream to temp file */
/* displayName is obtained from the URI */
File file = new File(context.getCacheDir(), displayName);
OutputStream output = new FileOutputStream(file);
byte[] buffer = new byte[4 * 1024]; // or other buffer size
int read;
while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
output.flush();
final String outputPath = file.getAbsolutePath();
return outputPath;
|
Cannot read property 'string' of undefined Trying to understand React Native Native Modules via react-native-create-brid
Tag : ios , By : Steve Jones
Date : March 29 2020, 07:55 AM
I wish this help you You need to install and import prop-types.It is no longer a part of React. npm install prop-types --save
import PropTypes from 'prop-types';
ThirdSquareView.propTypes = {
exampleProp: PropTypes.string
}
|
React Native archive error: Unable to find React Native files. Make sure "react-native" module is installed in
Date : March 29 2020, 07:55 AM
it should still fix some issue After investigating some issues such as https://github.com/facebook/react-native/issues/22354 I've found the problem after several hours: I had a space in my project path. I've moved my project to a path without space and it started to archive perfectly. Apparently, it really was a bug with React Native.
|
React Native Runtime Error: No native client found. Is Bugsnag React Native installed in your native code project?
Date : March 29 2020, 07:55 AM
it fixes the issue if you did react-native link bugsnag-react-native. Then you will need following changes if you are having this issue. I found the solution. In you Android/settings.gradle put the include bugsnag-react-native under include ':app' include ':app'
include ':bugsnag-react-native'
project(':bugsnag-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/bugsnag-react-native/android')
libz.tbd and
libBugsnagReactNative.a
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(), BugsnagReactNative.getPackage()
|
React Native - How to persist a Firebase authenticated user session from react-native app to a (react-native-webview) we
Date : March 29 2020, 07:55 AM
seems to work fine I have a react-native app which uses Firebase (with "@react-native-firebase/auth": "^6.0.1"). , I finally solved it and hope it will help others: state = {
shouldRenderWebview: false,
authorization: ''
...
auth()
.currentUser.getIdTokenResult()
.then(result => {
this.setState({
authorization: result.token,
shouldRenderWebview: true,
});
})
const Authorization = 'Bearer ' + this.state.authorization;
<WebView
source={{
uri: this.state.urlToGo,
headers: {
Authorization,
},
}}
....
firebase.auth().verifyIdToken(req.headers.authorization.substr(7));
|