Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 16566 articles
Browse latest View live

Can't access to camera through react-native-webview

$
0
0

I am using react-native-webview version 4.0.2 . So I have a webview that contains an add button that allows us to take picture with the camera but when clicking at that button nothing is shown and no camera permission shown : this is on android side but working very well on ios (i can see permission and access to camera ) . In my AndroidManifest.xml i do have :

<uses-permission android:name="android.permission.CAMERA" /><uses-feature android:name="android.hardware.camera"      android:required="false"/><uses-feature android:name="android.hardware.camera.autofocus"     android:required="false"/> 

So please do you have any suggestion ?


iOS simulator - AWS S3 Upload small picture EntityTooLarge

$
0
0

I'm currently using AWS S3 upload, concerning picture upload, mostly small ones, ID Card, Shots, not large ones.On Real Devices (Android), the upload works well, however, on iOS Simulator, I'm keep having these errors :

"<?xml version="1.0" encoding="UTF-8"?><Error><Code>EntityTooLarge</Code><Message>Your proposed upload exceeds the maximum allowed size</Message>. <ProposedSize>50930</ProposedSize><MaxSizeAllowed>49156</MaxSizeAllowed>. <RequestId>...RequestId...</RequestId>. <HostId>....idHost....</HostId></Error>"

My file got a size indeed of 49156, and when doing the basics request, I'm using it, but when validate the upload on S3, I don't know why it's setting the size to 50930 (in the example above)...

My FormData looks like this :

data: FormData_parts: Array(10)0: (2) ["key", "users/blabla/kyc-blabla.jpg"]1: (2) ["acl", "private"]2: (2) ["bucket", "mybucket.eu"]3: (2) ["X-Amz-Algorithm", "AWS4-HMAC-SHA256"]4: (2) ["X-Amz-Credential", "credential"]5: (2) ["X-Amz-Date", "date"]6: (2) ["Policy", "policyInfos"]7: (2) ["X-Amz-Signature", "signature info"]8: (2) ["Content-Type", "image/jpeg"]9: Array(2)   0: "file"   1:     name: "6DC54103-30CE-4017-9BCA-65B4838BDAF4.jpg"     size: 49156     type: "image/jpeg"     uri: "6DC54103-30CE-4017-9BCA-65B4838BDAF4.jpg"

It works well on Android.

How to do nested navigation in stack navigator from child to another child v5?

$
0
0

I got stuck at a point where i want to do some nested navigation from child screen to another child screen. Below is my required stack navigation.

  Home Screen     -> Add User     -> View Users           -> No Users(Shown only incase no users found)          -> Users List(Shown when users Data found)              ->View Details

Below is the code which i tried to replicate the above stack navigator with nested navigation for ViewUsers. But i was confused in implementing from thishttps://reactnavigation.org/docs/nesting-navigators/

 const HomeStack = createStackNavigator(); function UserDetailsRoot(){ return (<HomeStack.Navigator><HomeStack.Screen name="No Users" component={NoUsers} /><HomeStack.Screen name="Users List" component={UsersList} /><HomeStackScreen  name="User Details" component={UserDetails} /></HomeStack.Navigator>   ) } const HomeStackScreen = () => (<HomeStack.Navigator><HomeStack.Screen name="Home " component={HomeScreen} /><HomeStack.Screen name="Add User" component={AddUsers} /><HomeStack.Screen name="UserDetailsRoot" component={UserDetailsRoot} /></HomeStack.Navigator>);export default () => (<NavigationContainer><HomeStackScreen /></NavigationContainer>);

Any help is appreciated.Thanks.

React Native - Deep linking is not working when app is not in background (Android, iOS)

$
0
0
  • if app in background

    specific screen will open.

  • if app is not in background or kill the app

    it will show first screen only.

Linking.getInitialURL() is return null

React-native react-native-swipe-up-down-fix plugin does not work properly with tab bar

$
0
0

I want to implement swipe gesture in the app for that i tired react-native swipe-up-down plugin it worked perfectly without footer tab-bar in the app, but when i add tab-bar in the footer then it works fine and swipe-mini is visible when the app/page reload, but once user do swipe-up and then tries to perform swipe down then show-mini is not visible actully it hides below the footer tabbar.

Handle StatusBar tap/onPress in iOS (React Native)

$
0
0

Is there any way i can control the tap or onPress of StatusBar in iOS? By clicking on centre of the status bar scrolls the list to top. I would like to override this and provide my own logic.is it possible?

I have tried adding listener to listen for the onPress change using addListener but no such function. I have also tried wrapping StatusBar with TouchableOpacity, still it does not work.

Change backgroundColor BEHIND keyboard with React Native?

$
0
0

This sounds needless and crazy, but it's actually much more sane than it sounds.

I've been trying to find a way to do this and am pretty close to giving up. Currently I assume it's not possible.

What I'd like to do is change the color behind the keyboard so that the app doesn't have a big white area in the app switcher.

enter image description here

Problem in React Native v0.62.2 with Flipper pods and post install hooks

$
0
0

Im new in react native, and i facing the problem: Im using react native with flipper pods, and my pod file contain this code:

add_flipper_pods!  post_install do |installer|    flipper_post_install(installer)  end

But i need change my deployment target version of other pods with

post_install do |pi|    pi.pods_project.targets.each do |t|      t.build_configurations.each do |config|        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'      end    end  end

I get 3 different bugs, when try to solve this.How can i get combine this two hooks, or get other solutions to this problem?My pod file:

platform :ios, '9.0'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'def add_flipper_pods!(versions = {})  versions['Flipper'] ||= '~> 0.33.1'  versions['DoubleConversion'] ||= '1.1.7'  versions['Flipper-Folly'] ||= '~> 2.1'  versions['Flipper-Glog'] ||= '0.3.6'  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'  versions['Flipper-RSocket'] ||= '~> 1.0'  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'  # List all transitive dependencies for FlipperKit pods  # to avoid them being linked in Release builds  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'end# Post Install processing for Flipperdef flipper_post_install(installer)  installer.pods_project.targets.each do |target|    if target.name == 'YogaKit'      target.build_configurations.each do |config|        config.build_settings['SWIFT_VERSION'] = '4.1'      end    end  endendtarget 'escapenavigator' do  # Pods for escapenavigator  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"  pod 'React', :path => '../node_modules/react-native/'  pod 'React-Core', :path => '../node_modules/react-native/'  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'  # post_install do |pi|  #   pi.pods_project.targets.each do |t|  #     t.build_configurations.each do |config|  #       config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'  #     end  #   end  # end  target 'escapenavigatorTests' do    inherit! :complete    # Pods for testing  end  use_native_modules!  # Enables Flipper.  #  # Note that if you have use_frameworks! enabled, Flipper will not work and  # you should disable these next few lines.  add_flipper_pods!  post_install do |installer|    flipper_post_install(installer)  endendtarget 'escapenavigator-tvOS' do  # Pods for escapenavigator-tvOS  target 'escapenavigator-tvOSTests' do    inherit! :search_paths    # Pods for testing  endend

Thanks!


connect Apple Store Connect API app to rails backend

$
0
0

I have an app build with react native and ruby on rails as backend. We deployed ios reactnative app to testflight. We can't figure how to connect ruby on rails api to ios app on testflight?

I have generate App Store Connect API key. not sure how to use the key.

Fatlane is unable to create the new app on apple developer portal

$
0
0

Fastlane env:

<details><summary>🚫 fastlane environment 🚫</summary>### Stack| Key                         | Value                                       || --------------------------- | ------------------------------------------- || OS                          | 10.14.6                                     || Ruby                        | 2.5.8                                       || Bundler?                    | false                                       || Git                         | git version 2.21.1 (Apple Git-122.3)        || Installation Source         | /usr/local/lib/ruby/gems/2.5.0/bin/fastlane || Host                        | Mac OS X 10.14.6 (18G5033)                  || Ruby Lib Dir                | /usr/local/Cellar/ruby@2.5/2.5.8/lib        || OpenSSL Version             | OpenSSL 1.1.1f  31 Mar 2020                 || Is contained                | false                                       || Is homebrew                 | false                                       || Is installed via Fabric.app | false                                       || Xcode Path                  | /Applications/Xcode.app/Contents/Developer/ || Xcode Version               | 11.3.1                                      |### System Locale| Error                       || --------------------------- || No Locale with UTF8 found 🚫 |### fastlane files:**No Fastfile found****No Appfile found**### fastlane gems| Gem      | Version | Update-Status || -------- | ------- | ------------- || fastlane | 2.150.1 | ✅ Up-To-Date  |### Loaded fastlane plugins:**No plugins Loaded**<details><summary><b>Loaded gems</b></summary>| Gem                       | Version      || ------------------------- | ------------ || did_you_mean              | 1.2.0        || slack-notifier            | 2.3.2        || atomos                    | 0.1.3        || CFPropertyList            | 3.0.2        || claide                    | 1.0.3        || colored2                  | 3.1.2        || nanaimo                   | 0.2.6        || xcodeproj                 | 1.17.0       || rouge                     | 2.0.7        || xcpretty                  | 0.3.0        || terminal-notifier         | 2.0.0        || unicode-display_width     | 1.7.0        || terminal-table            | 1.8.0        || plist                     | 3.5.0        || public_suffix             | 4.0.5        || addressable               | 2.7.0        || multipart-post            | 2.0.0        || word_wrap                 | 1.0.0        || tty-screen                | 0.8.0        || tty-cursor                | 0.7.1        || tty-spinner               | 0.9.3        || babosa                    | 1.0.3        || colored                   | 1.2          || highline                  | 1.7.10       || commander-fastlane        | 4.4.6        || excon                     | 0.75.0       || faraday                   | 1.0.1        || unf_ext                   | 0.0.7.7      || unf                       | 0.1.4        || domain_name               | 0.5.20190701 || http-cookie               | 1.0.3        || faraday-cookie_jar        | 0.0.6        || faraday_middleware        | 1.0.0        || fastimage                 | 2.1.7        || gh_inspector              | 1.1.3        || json                      | 2.3.1        || mini_magick               | 4.10.1       || multi_xml                 | 0.6.0        || rubyzip                   | 2.3.0        || security                  | 0.1.3        || xcpretty-travis-formatter | 1.0.0        || dotenv                    | 2.7.5        || bundler                   | 2.1.4        || naturally                 | 2.2.0        || simctl                    | 1.6.8        || jwt                       | 2.1.0        || uber                      | 0.1.0        || declarative               | 0.0.20       || declarative-option        | 0.1.0        || representable             | 3.0.4        || retriable                 | 3.1.2        || mini_mime                 | 1.0.2        || multi_json                | 1.14.1       || signet                    | 0.14.0       || memoist                   | 0.16.2       || os                        | 1.1.0        || googleauth                | 0.13.0       || httpclient                | 2.8.3        || google-api-client         | 0.38.0       || google-cloud-env          | 1.3.2        || google-cloud-errors       | 1.0.1        || google-cloud-core         | 1.5.0        || digest-crc                | 0.6.0        || google-cloud-storage      | 1.26.2       || emoji_regex               | 3.0.0        || jmespath                  | 1.4.0        || aws-partitions            | 1.337.0      || aws-eventstream           | 1.1.0        || aws-sigv4                 | 1.2.1        || aws-sdk-core              | 3.103.0      || aws-sdk-kms               | 1.35.0       || aws-sdk-s3                | 1.72.0       |</details>*generated on:* **2020-07-03**</details>

I am unable to create a new app and Fastlane doesn't even specify why I am unable to create it. I am just shown a message that something went wrong. Any help would be appreciated.

Fastlane stuck at app creation

React Native Drag and Drop FlatList Display Index

$
0
0

I am using a certain react-native package to display a drag and drop flatlist; the API can be found here: https://github.com/computerjazz/react-native-draggable-flatlist. I am new to react native and I want the drag and drop flatlist to display the rank in the list on the list element. For example, if my list looked something like this:

1- Item A

2- Item B

3- Item C

and I drag Item C to the top, it should look something like this:

1- Item C

2- Item A

3- Item B

Notice how the 1. 2. 3. stay the same on the left. I am not sure how to do that. Instead, I get something like this:

3- Item C

1- Item A

2- Item B

I would really appreciate the support :)

My code looks like this:

{

    /** @format */import React from "react";import {    Text,    ScrollView,    View,    TouchableOpacity,    StyleSheet,    FlatList,    PanResponder,    Animated,} from "react-native";import Icon from "react-native-vector-icons/Ionicons";import { globalStyles, deviceHeight, deviceWidth } from "../styles/global";import { withNavigation } from "react-navigation";import DraggableFlatList from "react-native-draggable-flatlist";const exampleData = [    {        name: "Turkey Trot",        teamsCompeting: 32,        teamList: [            {                number: "919A",                name: "Reverb",                wins: 4,                loss: 1,                ties: 0,                autonomousWins: 3,                key: "1",            },            {                number: "9964S",                name: "Bender",                wins: 1,                loss: 3,                ties: 1,                autonomousWins: 1,                key: "2",            },        ],        key: "0",    },    {        name: "Patent Office",        teamsCompeting: 32,        teamList: [            {                number: "919A",                name: "Reverb",                wins: 4,                loss: 1,                ties: 0,                autonomousWins: 3,                key: "1",            },            {                number: "9964S",                name: "Bender",                wins: 1,                loss: 3,                ties: 1,                autonomousWins: 1,                key: "2",            },        ],        key: "1",    },    {        name: "States",        teamsCompeting: 32,        teamList: [            {                number: "919A",                name: "Reverb",                wins: 4,                loss: 1,                ties: 0,                autonomousWins: 3,                key: "1",            },            {                number: "9964S",                name: "Bender",                wins: 1,                loss: 3,                ties: 1,                autonomousWins: 1,                key: "2",            },        ],        key: "2",    },];class Competitions extends React.Component {    state = {        compData: exampleData,    };    renderItem = ({ item, index, drag, isActive }) => {        return (<TouchableOpacity                style={[                    globalStyles.listItemButton,                    { opacity: isActive ? 0.5 : 1 },                ]}                onPress={() => {                    this.props.navigation.navigate("Teams", item);                }}                onLongPress={drag}                delayLongPress={300}><Text style={globalStyles.listItemText}>                    {index}. {item.name}</Text></TouchableOpacity>        );    };    render() {        return (<View                style={[                    globalStyles.container,                    { justifyContent: "center", paddingBottom: 40 },                ]}><DraggableFlatList                    data={this.state.compData}                    renderItem={this.renderItem}                    keyExtractor={(item, index) =>                        `draggable-item-item-${item.key}`                    }                    onDragEnd={({ data }) => this.setState({ compData: data })}                /><TouchableOpacity                    style={globalStyles.addItemButton}                    onPress={() => {                        this.props.navigation.navigate("AddCompetitionScreen",                            Competitions                        );                    }}><Text                        style={[                            globalStyles.listItemText,                            { textAlign: "center" },                        ]}>                        Add Competition</Text></TouchableOpacity></View>        );    }}const styles = StyleSheet.create({});export default withNavigation(Competitions);

}

I have a flatlist in react Native but i press button save not reload data automatically

$
0
0

I have a flatlist in react Native but i press button save not reload data automatically and not render in flattest but i reload app and the item save appears

I need that I press button save the data render data automatically in a flatList I need help

strong text/**

  • #############################################################################
  • List screen.
  • #############################################################################*/class ListScreen extends React.Component {

/**

  • Constructor.*/constructor(props) {
super(Props);this.state = {  listData : [ ]};

} /* End constructor. */

/**

  • Render this component.*/render() { return (
<Root><View style={styles.listScreenContainer}>    { /* ########## Add Restaurant button ########## */ }<CustomButton      text="Add Restaurant"      width="94%"      onPress={ () => { this.props.navigation.navigate("AddScreen"); } }    />    { /* ########## Restaurant list ########## */ }<FlatList      style={styles.restaurantList}      data={this.state.listData}      renderItem={ ({item}) =><View style={styles.restaurantContainer}><Text style={styles.restaurantName}>{item.name}</Text><CustomButton            text="Delete"            onPress={ () => {              Alert.alert("Please confirm","Are you sure you want to delete this restaurant?",                [                  { text : "Yes", onPress: () => {                    // Pull data out of storage.                    AsyncStorage.getItem("restaurants",                      function(inError, inRestaurants) {                        if (inRestaurants === null) {                          inRestaurants = [ ];                        } else {                          inRestaurants = JSON.parse(inRestaurants);                        }                        // Find the right one to delete and splice it out.                        for (let i = 0; i < inRestaurants.length; i++) {                          const restaurant = inRestaurants[i];                          if (restaurant.key === item.key) {                            inRestaurants.splice(i, 1);                            break;                          }                        }                        // Store updated data in storage.                        AsyncStorage.setItem("restaurants",                          JSON.stringify(inRestaurants), function() {                            // Set new state to update list.                            this.setState({ listData : inRestaurants });                            // Show toast message to confirm deletion.                            Toast.show({                              text : "Restaurant deleted",                              position : "bottom",                              type : "danger",                              duration : 2000                            });                          }.bind(this)                        );                      }.bind(this)                    );                  } },                  { text : "No" },                  { text : "Cancel", style : "cancel" }                ],                { cancelable : true }              )          } } /></View>      }    /></View></Root>

); } /* End render(). */

/**

  • Execute after the component mounts.*/componentDidMount() {
// Block hardware back button on Android.BackHandler.addEventListener("hardwareBackPress", () => { return true; });// Get list of restaurants.AsyncStorage.getItem("restaurants",  function(inError, inRestaurants) {    if (inRestaurants === null) {      inRestaurants = [ ];    } else {      inRestaurants = JSON.parse(inRestaurants);    }    this.setState({ listData : inRestaurants });  }.bind(this));

}; /* End componentDidMount() */

} /* End ListScreen. */

/**

  • #############################################################################
  • Add screen.
  • #############################################################################*/class AddScreen extends React.Component {

/**

  • Constructor.*/constructor(props) {
super(props);this.state = {  name : "",  cuisine : "",  price : "",  rating : "",  phone : "",  address : "",  webSite : "",  delivery : "",  key : `r_${new Date().getTime()}`};

} /* End constructor. */

/**

  • Render this component.*/render() { return (
<ScrollView style={styles.addScreenContainer}><View style={styles.addScreenInnerContainer}><View style={styles.addScreenFormContainer}>      { /* ########## Name ########## */ }<CustomTextInput        label="Name"        maxLength={20}        stateHolder={this}        stateFieldName="name"      />      { /* ########## Cuisine ########## */ }<Text style={styles.fieldLabel}>Cuisine</Text><View style={styles.pickerContainer}><Picker          style={styles.picker}          prompt="Cuisine"          selectedValue={this.state.cuisine}          onValueChange={            (inItemValue) => this.setState({ cuisine : inItemValue })          }><Picker.Item label="" value="" /><Picker.Item label="Algerian" value="Algerian" /><Picker.Item label="American" value="American" /><Picker.Item label="BBQ" value="BBQ" /><Picker.Item label="Belgian" value="Belgian" /><Picker.Item label="Brazilian" value="Brazilian" /><Picker.Item label="British" value="British" /><Picker.Item label="Cajun" value="Cajun" /><Picker.Item label="Canadian" value="Canadian" /><Picker.Item label="Chinese" value="Chinese" /><Picker.Item label="Cuban" value="Cuban" /><Picker.Item label="Egyptian" value="Egyptian" /><Picker.Item label="Filipino" value="Filipino" /><Picker.Item label="French" value="French" /><Picker.Item label="German" value="German" /><Picker.Item label="Greek" value="Greek" /><Picker.Item label="Haitian" value="Haitian" /><Picker.Item label="Hawaiian" value="Hawaiian" /><Picker.Item label="Indian" value="Indian" /><Picker.Item label="Irish" value="Irish" /><Picker.Item label="Italian" value="Italian" /><Picker.Item label="Japanese" value="Japanese" /><Picker.Item label="Jewish" value="Jewish" /><Picker.Item label="Kenyan" value="Kenyan" /><Picker.Item label="Korean" value="Korean" /><Picker.Item label="Latvian" value="Latvian" /><Picker.Item label="Libyan" value="Libyan" /><Picker.Item label="Mediterranean" value="Mediterranean" /><Picker.Item label="Mexican" value="Mexican" /><Picker.Item label="Mormon" value="Mormon" /><Picker.Item label="Nigerian" value="Nigerian" /><Picker.Item label="Other" value="Other" /><Picker.Item label="Peruvian" value="Peruvian" /><Picker.Item label="Polish" value="Polish" /><Picker.Item label="Portuguese" value="Portuguese" /><Picker.Item label="Russian" value="Russian" /><Picker.Item label="Salvadorian" value="Salvadorian" /><Picker.Item label="Sandwiche Shop" value="Sandwiche Shop" /><Picker.Item label="Scottish" value="Scottish" /><Picker.Item label="Seafood" value="Seafood" /><Picker.Item label="Spanish" value="Spanish" /><Picker.Item label="Steak House" value="Steak House" /><Picker.Item label="Sushi" value="Sushi" /><Picker.Item label="Swedish" value="Swedish" /><Picker.Item label="Tahitian" value="Tahitian" /><Picker.Item label="Thai" value="Thai" /><Picker.Item label="Tibetan" value="Tibetan" /><Picker.Item label="Turkish" value="Turkish" /><Picker.Item label="Welsh" value="Welsh" /></Picker></View>      { /* ########## Price ########## */ }<Text style={styles.fieldLabel}>Price</Text><View style={styles.pickerContainer}><Picker          style={styles.picker}          selectedValue={this.state.price}          prompt="Price"          onValueChange={            (inItemValue) => this.setState({ price : inItemValue })          }><Picker.Item label="" value="" /><Picker.Item label="1" value="1" /><Picker.Item label="2" value="2" /><Picker.Item label="3" value="3" /><Picker.Item label="4" value="4" /><Picker.Item label="5" value="5" /></Picker></View>      { /* ########## Rating ########## */ }<Text style={styles.fieldLabel}>Rating</Text><View style={styles.pickerContainer}><Picker          style={styles.picker}          selectedValue={this.state.rating}          prompt="Rating"          onValueChange={            (inItemValue) => this.setState({ rating : inItemValue })          }><Picker.Item label="" value="" /><Picker.Item label="1" value="1" /><Picker.Item label="2" value="2" /><Picker.Item label="3" value="3" /><Picker.Item label="4" value="4" /><Picker.Item label="5" value="5" /></Picker></View>      { /* ########## Phone ########## */ }<CustomTextInput        label="Phone Number"        maxLength={20}        stateHolder={this}        stateFieldName="phone"      />      { /* ########## Address ########## */ }<CustomTextInput        label="Address"        maxLength={20}        stateHolder={this}        stateFieldName="address"      />      { /* ########## Web Site ########## */ }<CustomTextInput        label="Web Site"        maxLength={20}        stateHolder={this}        stateFieldName="webSite"      />      { /* ########## Delivery ########## */ }<Text style={styles.fieldLabel}>Delivery?</Text><View style={styles.pickerContainer}><Picker          style={styles.picker}          prompt="Delivery?"          selectedValue={this.state.delivery}          onValueChange={            (inItemValue) => this.setState({ delivery : inItemValue })          }><Picker.Item label="" value="" /><Picker.Item label="Yes" value="Yes" /><Picker.Item label="No" value="No" /></Picker></View></View>    { /* ########## Buttons ########## */ }<View style={styles.addScreenButtonsContainer}><CustomButton        text="Cancel"        width="44%"        onPress={          () => { this.props.navigation.navigate("ListScreen"); }        }      /><CustomButton        text="Save"        width="44%"        onPress={ () => {          AsyncStorage.getItem("restaurants",            function(inError, inRestaurants) {              if (inRestaurants === null) {                inRestaurants = [ ];              } else {                inRestaurants = JSON.parse(inRestaurants);              }              inRestaurants.push(this.state);              AsyncStorage.setItem("restaurants",                JSON.stringify(inRestaurants), function() {                  this.props.navigation.navigate("ListScreen");                }.bind(this)              );            }.bind(this)          );        } }      /></View></View></ScrollView>

); } /* End render(). */

} /* End AddScreen. *

Expo Camera preview component started displaying black screen out of the blue

$
0
0

The Camera preview component from the npm package 'expo-camera' doesn't show anything but a black screen. I've even created a brand new managed Expo project with nothing but this code:

import React from 'react';import { StyleSheet, Text, View } from 'react-native';import { Camera } from 'expo-camera';export default function App() {  return (<View style={styles.container}><Camera /></View>  );}const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: '#fff',    alignItems: 'center',    justifyContent: 'center',  },});

This is my package.json file:

{"main": "node_modules/expo/AppEntry.js","scripts": {"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject"  },"dependencies": {"expo": "^35.0.0","expo-camera": "^7.0.0","react": "16.8.3","react-dom": "16.8.3","react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz","react-native-web": "^0.11.7"  },"devDependencies": {"babel-preset-expo": "^7.1.0"  },"private": true}

And this is my app.json:

{"expo": {"name": "testcamera","slug": "testcamera","privacy": "public","sdkVersion": "35.0.0","platforms": ["ios","android","web"    ],"version": "1.0.0","orientation": "portrait","icon": "./assets/icon.png","splash": {"image": "./assets/splash.png","resizeMode": "contain","backgroundColor": "#ffffff"    },"updates": {"fallbackToCacheTimeout": 0    },"assetBundlePatterns": ["**/*"    ],"ios": {"supportsTablet": true    }  }}

It just stopped working out of the blue. Last thing I did was publish the Expo project, and it was working before that.

how can i reduce expo build ios size, it is around 188 MB,

$
0
0

I have successfully run the expo build: ios command but the resultant IPA file is close to 188MB which is really strange as the app has only a few pages with listViews etc. What may be the reason for such a huge size? The same build size for Android is only about 22MB.

How to save data and then share it with React Native? [closed]

$
0
0

I am beginner to building Apps with React Native + Redux.I am trying to create an App family budget. It's almost done.BUT I have two questions for them who already created these kind of apps.

  1. What is the best way to save data? I want to save it (data: expenses/dates/category etc) on devices iOS (not database) if it's possible. I think it does not take a lot of memory. I've read about AsyncStorage, but not sure about it. Is it still present after reloading App/Phone?

  2. How to share data between two users? I want to make a function, like sharing the budget between family members.

I will be very grateful for the recommendations and suggestions, maybe even for some good articles with explanation.Thanks!


How do you specify an apple-app-site-association file path to match query strings?

$
0
0

I'm trying to set up universal linking in a mobile app I am building. The path I'm trying to match on my website is www.mywebsite.com/route?query=xxx

The apple docs have an example apple-app-site-association file that looks like this.

{"applinks": {"apps": [],"details": [            {"appID": "9JA89QQLNQ.com.apple.wwdc","paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"]            },            {"appID": "ABCD1234.com.apple.wwdc","paths": [ "*" ]            }        ]    }}

But this example does not have an example of a path with a query string.

How can I match my route www.mywebsite.com/route?query=xxx in my apple-app-site-association file?

Thank you

Keep getting font family undefined with react native - links vector icons - build tells me to unlink

$
0
0

I've installed galio framework, but I also have react native vector icons installed.

I'm doing react native by itself (not expo). And occassionally, more often I'm getting undefined font family, whether it be Feather or Font Awesome.

I've searched on the internet, and people say do react-native link react-native-vector-icons so I do that, fixes the problem temporarily, and then it happens again. I run the link again, and fixes again, then happens over and over.

Then when I close the simulator, and run npx react-native run-ios, build fails tells me that I need to unlink the react native vector icons...

React Native run iOS: Error: Could not connect to development server

$
0
0

I'm new to React Native, I'm trying to run my project on iPhone simulatorbut I keep getting red error screen: Could not connect to development server.

I changed the ip address in app delegate , and made sure that metro server is running on the same ip. and the address is accessible in Chrome and running. But no results whatsoever.

Error when running on iPhone simulator

Here is my appDelegate.m file:

    @implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];  NSURL *jsCodeLocation;  jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.103:8081/index.ios.bundle?platform=ios&dev=true"];  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];  [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:self];  [FIRApp configure];  return YES;}- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge{  NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];  // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!  return extraModules;}- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{#if DEBUG  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];#else  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];#endif}@end

I've looked into and tried many answers on StackOverFlow. But no results whatsoever.

Any help?

Why is react native ordered elements in reverse order (just for iOS)?

$
0
0

The project is setup in a bespoke manner, so I will try to create a reproducible problem. But if anyone could help with why this might be happening, as I'm truly lost.

Im using RN version 0.59.9

If i have a simple component at the root:

<View><Text> Text 1</Text><Text> Text 2</Text></View>

In android, it behaves as expected, the text is displayed top left in the correct order.But in iOS it is aligned to the bottom left, and the Text 2 is at the top, and Text 1 at the bottom.

So its like there is a flexbox in col-reverse here.

Amongst things i'v tried:

  • Removing pods to see if anything changes
  • Looks for any abnormal styling getting injected with RN Debugger
  • Adding a flexbox to each view (This kind of works, some elements get aligned properly. Some don't)So its like there is something being injected into every single component, just for iOS though.

Does anyone have any idea what could be causing this?

My next steps in to update to RN 0.60+

React Native update - main.jsbundle - Native module cannot be null

$
0
0

I updated today from react-native 59.10 to 60.6. After some linking bugs in iOS, I was able to build the project on iOS. First I had the 'No bundle url' Error see here:stackoverflow

Then I executed the following command to rebuild my main.jsbundle file:

react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios

The error went away but a new occurred:Native module cannot be null

I can't really find a solution. I rebuilt the main.jsbundle file several times, but I still have this error. I also don't find similar errors online. Also, the error description is not really helpful.

I use this version:

"react": "16.8.6","react-native": "0.60.6",

If it helps, I can also post it package.json or my pods. I just don't know where to start.Thanks a lot!

Viewing all 16566 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>