react-native-android

How to send Base64 code to webservice webservice?

时光毁灭记忆、已成空白 提交于 2019-12-11 17:20:08
问题 I try to send my base64 code to my webservice : this is my base64 : I send like this : let collection= {}; collection.base64 = this.state.data; fetch('url', { method: 'POST', headers: new Headers({ Accept: 'application/json', 'Content-Type': 'application/json', // <-- Specifying the Content-Type }), body: JSON.stringify({'JsonWithImage': collection.base64 }), // data can be `string` or {object}! }) However, as you see it gives error message which is in image. I think because of size of image

Implement onPress on Flatlist item

人盡茶涼 提交于 2019-12-11 17:05:01
问题 I am trying to send the data of the flatlist items when clicked and set to another class.The ontouch is working but I am having the error below in the image. Also how can I send the data of api to the other class and get from another class? I have implemented as follows: export default class FlatSpeakers extends Component { constructor(props) { super(props); this.state = { isLoading: true, data: [],selectedItem: null, } const { navigate } = this.props.navigation; } onPressItem = () => {

To get Current Location Automatically in Reactnative

风流意气都作罢 提交于 2019-12-11 16:51:44
问题 I have this method to fetch current location by clicking button it will fetch current location . I want to fetch location without clicking that button . getLocationHandler = () =>{ navigator.geolocation.getCurrentPosition(pos =>{ const coordsEvent ={ nativeEvent :{ coordinate : { latitude : pos.coords.latitude, longitude : pos.coords.longitude } } }; this.pickLocationHandler(coordsEvent); }, err => { console.log(err); alert("Fetching the position failed,Please pick one manually") }) } 回答1:

How to broadcast a live video to YouTube channel using ReactNative in Ios/Android?

自作多情 提交于 2019-12-11 16:08:51
问题 Is it possible to broadcast a live video to YouTube channel using ReactNative in Ios/Android? 回答1: Try using this library https://www.npmjs.com/package/react-native-nodemediaclient https://github.com/NodeMedia/react-native-nodemediaclient import { NodeCameraView } from 'react-native-nodemediaclient'; ...... <NodeCameraView style={{ height: 400 }} ref={(vb) => { this.vb = vb }} outputUrl = {"rtmp://192.168.0.10/live/stream"}// out put to youTube camera={{ cameraId: 1, cameraFrontMirror: true }

Undefined function onClick in contentComponent

喜欢而已 提交于 2019-12-11 15:38:48
问题 Im trying to access a function inside a button on contentComponent that is inside a createDrawerNavigator. The problem is that the 'props' passed to the contentComponent does not have the function that im trying to access and i keep getting 'undefined'. Here's the code: const MainDrawer = createDrawerNavigator( { Home: { screen: HomeScreen, }, }, { contentComponent: (props) => ( <View style={{ flex: 1 }}> <SafeAreaView forceInset={{ top: 'always', horizontal: 'never' }}> <DrawerItems {..

App crashing react native on Samsung Galaxy S9+ (star2qltesq), Android 8.0

柔情痞子 提交于 2019-12-11 15:14:30
问题 I have released an app to the play store using react native and its working fine but I got a crash with the following log in play console and I'm not sure what to make of it. The crash happens on Samsung Galaxy S9+ (star2qltesq) running Android 8.0 backtrace: #00 pc 000000000001a6f0 /system/lib/libc.so (strlen+11) #01 pc 0000000000761c39 /vendor/lib/libllvm-glnext.so (_ZN14MetaDataExport19duplicateSymbolDataEP20QGLC_GLSL_SYMBOLDATAPKS0_+208) #02 pc 0000000000766d87 /vendor/lib/libllvm-glnext

In React-Native Buttons are not clickable when I applied slide up animation

╄→гoц情女王★ 提交于 2019-12-11 10:17:18
问题 I am creating a view. Inside view there are some buttons and all buttons are clickable. I created those view . working fine all buttons are clickable though. Now my requirement is that view should have slide up animation. so I searched a little and found Here. Modified my code as per requirements and animation was working fine. But the problem is after animation my buttons are not clickable any more. Please help me I Checked on iOS simulator it was working fine, button was clickable though

Importing 'react-native-vector-icon' results 'Unable to resolve module '@expo/vector-icons' error

最后都变了- 提交于 2019-12-11 10:08:52
问题 error: bundling failed: Error: Unable to resolve module `@expo/vector-icons/Ionicons` from `E:\React Projects\Tourism\src\screens\TouristInformation\TouristInformation.js`: Module `@expo/vector-icons/Ionicons` does not exist in the Haste module map This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`. 3. Reset

W/ReactNativeJS: Possible Unhandled Promise Rejection (id: 3 AND 4)

眉间皱痕 提交于 2019-12-11 09:58:51
问题 I recently ejected my react-native project and the camera feature is not working. The code allows users to upload images. It works with expo but after eject and running with Android, it stopped working. This is code for the camera upload: import * as Permissions from 'expo-permissions'; import * as ImagePicker from 'expo-image-picker'; _checkPermissions = async () => { const { status } = await Permissions.askAsync(Permissions.CAMERA); this.setState({ camera: status }); // take permission for

Pass data between two components in React Native

泪湿孤枕 提交于 2019-12-11 08:07:23
问题 I have a component that encapsulates three components one of them is the DrawerLayoutAndroid . Now I want to pass the reference of the drawer from the drawer component to the main component and then pass it to the header component so I can trigger it from the header component. I have no idea how to do that. Here is the main component 'cases.js' import React, { Component } from 'react'; import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; import Header from '@components