react-native-ios

How to Make HTTP Requests In React Native IOS application?

こ雲淡風輕ζ 提交于 2019-12-04 23:38:08
问题 fetch('http://119.9.52.47:3000/api/countries', { method: 'POST', headers: { 'Accept': 'application/json','Content-Type': 'application/json'}, }).then((response) => response.json()) .then((responseData) => { console.log(responseData); }) Here is my code . But that's not work. 回答1: you can try like this for send data to server(POST) let response = await fetch( 'http://your_url', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON

Trying to build to tablet, wanted dev team profile, added one, but now failing for same for “tests”

倖福魔咒の 提交于 2019-12-04 19:35:44
I am on iOS, creating a react-native iOS app. I was using the simulator but the resolution doesn't look right, its got this black padding etc. So I was trying to test on a device. I plugged my device in then clicked "Run". It failed under "navi" for reason "Dependency Analysis Error - Signing for "navi" requires a development team. Select a development team in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.3'" - screenshot: http://i.imgur.com/brazAhq.png So I went to "General" then in signing I clicked "Add Account" then signed in. Then I selected

How To Add More component dynamically React Native

狂风中的少年 提交于 2019-12-04 17:02:42
I want to add more components after clicking on the button. Can you share code or an idea so that I can implement? As the image shows, every time when user click on the add button, one row / component will be added. It's where state shining of, for example: constructor(props) { super(props); this._handleAddButton = this._handleAddButton.bind(this); this.state = { /* initial your state. without any added component */ data: [] } } _handleAddButton() { let newly_added_data = { title: 'new title', content: 'new content goes here' }; this.setState({ data: [...this.state.data, newly_added_data] });

how to get offline bunduling of ios in react native

我的梦境 提交于 2019-12-04 14:17:06
问题 Anyone could you please explain how to generate offline bundle of ios application from 'react native' code. Already I tried "How to generate .ipa file for react-native?" but this not working. 回答1: react-native run-ios --configuration=release Will run your app on Simulator or Device with the bundle. Or just build it from Xcode (release build always includes the bundle) Or run the debug release but before that, you should : react-native bundle --dev false --entry-file index.ios.js --bundle

Adjacent JSX elements must be wrapped in an enclosing tag

二次信任 提交于 2019-12-04 11:21:09
I want to have a navigation bar at the bottom and a toolbar at the top of every page in my React-Native app. However, if I create these two elements in the index.ios.js file, I get the error: "Adjacent JSX elements must be wrapped in an enclosing tag". If I put tags surrounding the Navigator and NavBar I just see a blank screen in my app. What should I do? Here is what my render function looks like in index.ios.js render() { return ( <Navigator initialRoute={{name: 'Login'}} renderScene={this.renderScene} navigationBar={ <Navigator.NavigationBar style={ styles.nav } routeMapper={

Cannot use Live Reload/Hot Reload on a device

只愿长相守 提交于 2019-12-04 11:02:33
Everything is fine when I am developing on a simulator but right now I am in the phase where my app is almost done but have to change some visual small things on a real device. For this reason I would like to have the same option as when testing on a simulator: Live reload or Hot reload. Here is the popup when I shake the device: As you can see I do not have the options: "Enable Live Reload" or "Enable Hot Reload". Also if I make a change in any file and press just "Reload" the change is not happening on the device. My phone and my computer are using the same WiFi networks - checked several

How to Set background image of DrawerNavigator in React-Native?

本小妞迷上赌 提交于 2019-12-04 09:48:45
I integrate DrawerNavigator in my project. its working fine, but there are no any property to set background image. How can I will add background image in DrawerNavigator. DrawerNavigator Code of DrawerNavigation import { AppRegistry , Dimensions} from 'react-native'; import Library from './ViewControllers/Library'; import Language from './ViewControllers/Language'; import AboutUS from './ViewControllers/AboutUS'; import Support from './ViewControllers/Support'; import { DrawerNavigator } from 'react-navigation'; const MyApp = DrawerNavigator({ Library: { screen: Library, }, Language: { screen

How to stop react-native link from linking a library with CocoaPods with it has a podspec?

旧巷老猫 提交于 2019-12-04 09:16:25
问题 I need to use CocoaPods for a specific library. However I don't want to use it for any other because it usually forces me to add React and its dependencies to the Podfile as well, which is a nuisance and can lead to several issues as in previous experiences. In React Native documentation (https://facebook.github.io/react-native/docs/linking-libraries-ios) it is specifically said: If your iOS project is using CocoaPods (contains Podfile) and linked library has podspec file, then react-native

React Native endless stream of Socket SO_ERROR

北城余情 提交于 2019-12-04 09:15:51
I'm working on an existing React Native project and in XCode log output I get an endless stream of the following errors 2019-01-09 12:15:49.005630+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.1:1] Socket SO_ERROR [61: Connection refused] 2019-01-09 12:15:49.016640+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.2:1] Socket SO_ERROR [61: Connection refused] 2019-01-09 12:15:49.017800+0000 App [13746:3543010] [] nw_connection_get_connected_socket [C10] Client called nw_connection_get_connected_socket on unconnected nw_connection How could I go about figuring out

A Custom Tab bar with two images in each tab using react navigation?

柔情痞子 提交于 2019-12-04 05:49:32
I am creating an app using React Native for ios. Instead of having an active tintColor I want to have two little triangles (another image/icon) which appears when you are on the selected tab. It is important that the center y axis of the triangles is = to the y axis of the bottom of the tabbar image and that the tab icon is in the center of the triangles as seen below. At the moment I have the tab bar, the icons and navigation working - I just don't know how to make the triangles appear: ICON TABS import React, {Component} from 'react'; import { Image, TouchableOpacity, View } from 'react