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

How caused this error? Expo - React Native

$
0
0

expo build:ios|bi bash: bi: command not found Cannot call write after a stream was destroyed Set EXPO_DEBUG=true in your env to view the stack trace.

After I executed 'expo build:ios|bi', I received this error and nothing additional. The command was executed on linux.


How to send a text message directly from the mobile apication

$
0
0

I want to send a text message to a recepient from within the application in react native. The programming language currently I am using is react native. Inside my application I have a send button which should directly send the message to the person. I don't want the default messaging application to open to send the message. I tried an expo library and few npm libraries which are dedicated for sending text messages but all of them opens the default messaging application when the send button is clicked within my mobile application. Any library which suits my requirement or is it possible to do so? If it isn't possible how can I achieve it?

What caused this error? Expo - React Native

$
0
0

expo build:ios|bi bash: bi: command not found Cannot call write after a stream was destroyed Set EXPO_DEBUG=true in your env to view the stack trace.

After I executed 'expo build:ios|bi', I received this error and nothing additional. The command was executed on linux.

Accessibility issue: Voice over read out order for flatlist is incorrect

$
0
0

Voice over read out for Items which are rendered using flatlist is not in right order. issue can be reproduced only in IOS and in android it works fine. I have multiple interactive elements within column. imagine columns containing favorite icon, image, multiline text and add button. Expected behavior: it should first read out rollback icon, image, multiline text and add button from column 1 and then the same from 2nd column. Actual behavior: currently it is reading following order rollback icon (column 1 ) --> rollback icon (column 2) --> image (column 1 ) --> image(column 2)---> multiline text (column 1 ) --> multiline text(column 2) --> add button(column 1) --> add button(column 2)

import React from 'react';
import {
  StyleSheet,
  View,
  Text,
    Image,
    TouchableOpacity,
    SafeAreaView,
    FlatList,
    Dimensions,
} from 'react-native';

    const data = [
        { key: 'Apple', price:'$1.91 each' },
        { key: 'Organic Bananas, bunch', price:'$2.91/LB' },
        { key: 'Banana Babies', price:'$2.91 avg price' },
        { key: 'meat',price:'$20.91' },
        { key: 'Eggs' , price:'$12.91 avg price'},
        { key: 'Fish' , price:'$7.91 avg price'},
        { key: 'Green Apples', price:'$9.91 avg price' },
        { key: 'fresh fruits', price:'$6.91 avg price'},
        { key: 'Ice cream', price:'$2.91 avg price' }
    ];

    const numColumns=2;
class App extends React.Component{
    renderItem=({item,index})=>{
        return(
            <View style={styles.item}>
                <TouchableOpacity
                    style={styles.button}
                    onPress={this.onPress}
                     accessible={false}
                >
                    <Text style={styles.itemText1}>Rollback</Text>
                </TouchableOpacity>
                <View accessible={true}
                      accessibilityLabel="This is Demo Image">
                    <Image
                        style={{width: 75, height: 75}}
                        source={{uri: 'https://reactnative.dev/img/tiny_logo.png'}}/>
                </View>

                <Text  style={styles.itemText}>{item.key}</Text>
                <TouchableOpacity>
                    <Text style = {styles.button}>
                        ADD
                    </Text>
                </TouchableOpacity>
                <Text style={styles.itemText}>{item.price}</Text>
            </View>
        )
    };
    render(){
        return(
            <SafeAreaView style={styles.container1}>
            <FlatList
                data={data}
                style={styles.container}
                renderItem={this.renderItem}
                numColumns={numColumns}
            />
            </SafeAreaView>
        );
    }
}

const styles = StyleSheet.create({
  container: {
      flex:1,
      marginVertical:20,
  },
    container1: {
        flex: 1,
    },
  item: {
      backgroundColor:"grey",
      alignItems:'center',
      justifyContent:'center',
      flex:1,
      margin:1,
      height:Dimensions.get('window').width/numColumns,
  },
  itemText: {
    color:'#fff',
      paddingTop:5,
  },
    itemText1: {
       flexDirection:'row',
        color:'red',
        paddingBottom:4,
        justifyContent:'flex-end'
    },
    imageThumbnail: {
        justifyContent: 'center',
        alignItems: 'center',
        height: 100,
    },
    button: {
        backgroundColor: '#DDDDDD',
        margin:4
    },
});

export default App;

Command CodeSign failing with a nonzero exit code, Xcode 11.3.1

$
0
0

I'm a dev with zero mobile experience. Due to the virus I had free time and wanted to try get a basic ios mobile app built out. When I go to build my app in Xcode, it breaks down every time on step 528 of 569, right after the loading dependency graph message shows up in my terminal.

I have tried going into keychain access and every time:

Command CodeSign failed with a nonzero exit code

I have tried open keychain access -> lock the 'login' keychain -> unlocking it - > cleaning and rebuilding. Does not change anything. I have also tried simply rebooting my system. This too does not work. Any ideas out there?

Detox tests for iOS failing on Travis CI

$
0
0

My detox tests are running fine locally but whenever I run them from Travis, it seems to fail. For example, the following runs fine on local:

test('should have welcome screen and skip button hides on last frame', async() => {
    await expect(element(by.id('WelcomeScreen_Skip'))).toBeVisible();
    await expect(element(by.id('WelcomeScreen_Carousel'))).toBeVisible();
    await element(by.id('WelcomeScreen_Carousel')).swipe('left');
  });

However, the same block of code fails on Travis with the following error:

Welcome Screen › should have welcome screen and skip button hides on last frame

    An assertion failed.
    Exception with Assertion: {
      "Assertion Criteria":  "assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)",
      "Element Matcher":  "((!(kindOfClass('RCTScrollView')) && ((respondsToSelector(accessibilityIdentifier) && accessibilityID('WelcomeScreen_Skip')) && !(kindOfClass('UIAccessibilityTextFieldElement')))) || (((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(kindOfClass('RCTScrollView'))) && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('WelcomeScreen_Skip')) && !(kindOfClass('UIAccessibilityTextFieldElement')))))))"
    }


    Error Trace: [
      {
        "Description":  "Assertion with matcher [M] failed: UI element [E] failed to match the following matcher(s): [S]",
        "Description Glossary":    {
          "M":  "matcherForSufficientlyVisible(>=0.750000)",
          "E":  "<RCTTextView:0x7fa8cac55c10; AX=Y; AX.id='WelcomeScreen_Skip'; AX.label='Skip'; AX.frame={{320.66665649414062, 60}, {38.666656494140625, 24.333335876464844}}; AX.activationPoint={339.99998474121094, 72.166667938232422}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{0, 0}, {38.666656494140625, 24.333335876464844}}; alpha=1>",
          "S":  "matcherForSufficientlyVisible(>=0.750000)"
        },
        "Error Domain":  "com.google.earlgrey.ElementInteractionErrorDomain",
        "Error Code":  "3",
        "File Name":  "GREYAssertions.m",
        "Function Name":  "+[GREYAssertions grey_createAssertionWithMatcher:]_block_invoke",
        "Line":  "75"
      }
    ]

I noticed another unusual behavior. When I added the "waitFor" to the first two lines of await statement, those two lines passed but the third line with the "swipe" failed.

test('should have welcome screen and skip button hides on last frame', async() => {
    await waitFor(element(by.id('WelcomeScreen_Skip'))).toBeVisible();
    await waitFor(element(by.id('WelcomeScreen_Carousel'))).toBeVisible();
    await element(by.id('WelcomeScreen_Carousel')).swipe('left');
  });

Swiping is failing which doesn't make sense because the test says the same id passes on the line before. Here is the error:

Cannot perform action due to constraint(s) failure.
    Exception with Action: {
      "Action Name":  "Swipe Left for duration 0.1",
      "Element Description":  "<RCTCustomScrollView:0x7f967a1e0800; AX=N; AX.frame={{0, 126}, {375, 654}}; AX.activationPoint={187.5, 453}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 654}}; opaque; alpha=1>",
      "Failed Constraint(s)":  "interactable",
      "All Constraint(s)":  "(interactable && !(isSystemAlertViewShown) && kindOfClass('UIView') && respondsToSelector(accessibilityFrame))",
      "Recovery Suggestion":  "Adjust element properties so that it matches the failed constraint(s)."
    }


    [
      {
        "Description":  "Cannot perform action due to constraint(s) failure.",
        "Error Domain":  "com.google.earlgrey.ElementInteractionErrorDomain",
        "Error Code":  "1",
        "File Name":  "GREYBaseAction.m",
        "Function Name":  "-[GREYBaseAction satisfiesConstraintsForElement:error:]",
        "Line":  "66"
      }
    ]
Detox: 15.5.0
React Native: 0.61.2
Node: 13.0.1
Device: iPhone 11
Xcode: Xcode 10.2.1
macOS: 10.14.4
Test Runner: Jest

Open a .ppt file in the PowerPoint app from React Native (IOS)

$
0
0

I know I can use import {Linking} from 'react-native' in order to use Linking.canOpenURL(url) and open another app.

I can open PowerPoint by doing this: Linking.canOpenURL('ms-powerpoint://app') but I need to open a file there.

According to Microsoft's Documentation I should be able to do this:

Linking.canOpenURL('ms-powerpoint:ofv|u|https://blablabla.com/file.pptx') but the app tells me:

"Sorry, file.pptx is stored in an unsupported server location."

Another thing I thought was to first download the file and send the local path but, although it opens PowerPoint and shows a "Downloading/Opening" message, it shows like if it was a blank session.

Here's a small snippet of code:

import React from 'react';
import {Button, Linking} from 'react-native';
import RNFS, {DownloadFileOptions} from 'react-native-fs';

function ShowPPTComponent(props) { 

  function openFile() {
    const {file} = props;

    const temporalStoragePath = `${RNFS.DocumentDirectoryPath}/${file.name}.${file.extension}`;

    const options = {
      fromUrl: file.url,
      toFile: temporalStoragePath,
    };

    // Downloads the file.
    RNFS.downloadFile(options as DownloadFileOptions).promise.then(() => {
      const url = `ms-powerpoint:ofv|u|${temporalStoragePath}`;
      // Goes to PowerPoint
      return Linking.openURL(url);
    });
  }

  return (
     <Button onPress={openFile} title="Open in PowerPoint" />
  );
}

INFO PLIST

<key>LSApplicationQueriesSchemes</key>
    <array>
      <string>launch-ppt</string>
      <string>powerpoint</string>
      <string>ms-powerpoint</string>
      <string>open-ppt</string>
    </array>

Notes:

In another place of the app I've shown the IOS Share options and I was able to select PowerPoint and open the file and it works perfectly. So both the file and the PowerPoint application are doing good.

(The idea here is to not show the IOS Share Modal but directly open PowerPoint with a file).

Thanks in advance !

Is there a way to properly format with React-Intl where I don't get this error?

$
0
0

I am working on a React Native application where I need the post_date that I am getting back from a third-party API to not show up as: 2019-05-10 11:26:39, but instead display: x many days ago.

I tried installing React-Intl and then implementing it in App.js like so:

import React from "react";
import { StyleSheet, Text, View } from "react-native";
import {
  createBottomTabNavigator,
  createStackNavigator,
  createAppContainer
} from "react-navigation";
import { Provider } from "react-redux";
import { IntlProvider } from "react-intl";
import store from "./store";
import AuthScreen from "./screens/AuthScreen";
import WelcomeScreen from "./screens/WelcomeScreen";
import MapScreen from "./screens/MapScreen";
import DeckScreen from "./screens/DeckScreen";
import SettingsScreen from "./screens/SettingsScreen";
import ReviewScreen from "./screens/ReviewScreen";

const MainNavigator = createAppContainer(
  createBottomTabNavigator({
    welcome: WelcomeScreen,
    auth: AuthScreen,
    main: {
      screen: createBottomTabNavigator({
        map: MapScreen,
        deck: DeckScreen,
        review: {
          screen: createStackNavigator({
            review: ReviewScreen,
            settings: SettingsScreen
          })
        }
      })
    }
  })
);

export default class App extends React.Component {
  render() {
    return (
      <Provider store={store}>
        <View style={styles.container}>
          <IntlProvider locale="en">
            <MainNavigator />
          </IntlProvider>
        </View>
      </Provider>
    );
  }
}

And in my DeckScreen.js like so:

import React, { Component } from "react";
import { View, Text, Platform } from "react-native";
import { MapView } from "expo";
import { connect } from "react-redux";
import { Card, Button } from "react-native-elements";
// import Moment from "react-moment";
import { FormattedRelative } from "react-intl";
import Swipe from "../components/Swipe";
import * as actions from "../actions";

class DeckScreen extends Component {
  renderCard(job) {
    return (
      <Card title={job.title}>
        <View style={{ height: 300 }}>
          <MapView
            scrollEnabled={false}
            style={{ flex: 1 }}
            cacheEnabled={Platform.OS === "android" ? true : false}
          />
        </View>
        <View style={styles.detailWrapper}>
          <Text>{job.company.id}</Text>
          <FormattedRelative value={job.post_date.toString()} />
        </View>
        <Text>
          {job.description.replace(/<span>/g, "").replace(/<\/span>/g, "")}
        </Text>
      </Card>
    );
  }

I feel like I am closer to getting what I want with React-Intl than with Momentjs, but I am getting this error:

console.error: "[React Intl] Error formatting relative time. RangeError: The date value provided to IntlRelativeFormat#format() is not in valid range."

Is my code not formatted properly? Anyone have experience with how to implement FormattedRelative from React-Intl?

I know I can use toDateString() to get rid of the timestamp portion 2019-05-10 11:26:39 but when I try to implement it via <FormattedRelative value={job.post_date.toDateString()} />, I continue to get the same error message.


React Native - iOS - Change bundle Identifier change

$
0
0

I'm trying to change to name of the react-native application. I did change the bundle identifier and display name from the xcode. But now I'm getting the following error.

The following build commands failed:
Ld .../Library/Developer/Xcode/DerivedData/app-dpwytzlcpvhucvfjukbzdmmrhdzu/Build/Products/Debug-iphonesimulator/app.app/PlugIns/appTests.xctest/appTests normal x86_64
(1 failure)

Getting following error in Xcode

File not found: .../Library/Developer/Xcode/DerivedData/app-dpwytzlcpvhucvfjukbzdmmrhdzu/Build/Products/Debug-iphonesimulator/app.app/app

What am I missing?

react-native-table-component freeze first column & first row in scrollable table

$
0
0

Desired State

I'm using react-native-table-component, a basic component to render tables in React Native. I need to freeze the first column and first row in the table so they remain in view when scrolling. Specifically, I need the first column to remain fixed when scrolling horizontally and scroll with the rest of the data in the row when scrolling vertically.

I need the first row to function the same way. Remain fixed when scrolling vertically and when scrolling horizontally, I should scroll with the corresponding column.

Issue

I can get to my desired state for the first row but I can't do the same for the first column in the same table.

Code

render(){
    return(

    <View style={styles.tableContainer}>
    <ScrollView horizontal={true}>
     <View>
       <Table style={styles.tableHead}>

         <Row
          style={styles.header}
          textStyle={styles.text}
          data={this.props.tableHead}
          widthArr={this.props.columnWidth}
        />

       </Table>
       <ScrollView style={styles.dataWrapper}>

        <TableWrapper style={styles.tableBody}>
          <Col 
            style={styles.title} 
            textStyle={styles.text}
            data={this.props.tableTitle} 
            heightArr={[28,28]}  
        />
          <Rows 
            style={styles.row} 
            textStyle={styles.text}
            data={this.dataFormat()} 
            widthArr={this.props.columnWidth} 

            />
        </TableWrapper>
       </ScrollView>
     </View>
   </ScrollView>
  </View>
    )
}

Additional Information I don't need to use react-native-table-component but I'd like to if possible since I've already done a lot of work to style it and format the data I've inserted.

Thanks in advance for your help!

can't fetch from iphone device to my localhost using expo - react native

$
0
0

I am on the very first steps of my app creation. currently on the sign-in/sign-up screens. I'm trying to fetch from my iPhone device, using expo, to my server-side on my computer, but from some reason it doesn't work. so after long searches on the internet, these are the steps I've already done:

relevant code bellow:

const LoginScreen = ({ navigation }) => {

  const [email, setEmail] = useState({ value: '', error: '' });
  const [password, setPassword] = useState({ value: '', error: '' });

   const apiUrl = 'http://192.168.X.X:49948/api/Tourist';

  const _onLoginPressed = () => {
    const emailError = emailValidator(email.value);
    const passwordError = passwordValidator(password.value);

    if (emailError || passwordError) {
      setEmail({ ...email, error: emailError });
      setPassword({ ...password, error: passwordError });
      return;
    }
    else{

    const user = {
      Email: email.value,
      PasswordTourist: password.value
    };

    fetch(apiUrl, {
      method: 'POST',
      body: JSON.stringify(user),
      headers: new Headers({
        'Content-type': 'application/json; charset=UTF-8' //very important to add the 'charset=UTF-8'!!!!
      })

    })
      .then(res => {
        console.warn('res=', res);
        return res.json()
      })
      .then(
        (result) => {
          console.warn("fetch POST= ", result);
        },
        (error) => {
          console.warn("err post=", error);
        });

     // navigation.navigate('Dashboard');
    }


  };

app.json:

{
  "expo": {
    "name": "Blank Template",
    "slug": "IsraVisor",
    "privacy": "public",
    "sdkVersion": "36.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,
      "config" :{
        "googleSignIn":{
          "reservedClientId": "com.googleusercontent.apps.369112967382-tqc9ttloirgp9ne76rfmbdc3upmv26kf"
        }
      }
    }
  }
}

package.json:

{
  "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/vector-icons": "^10.0.6",
    "@react-native-community/google-signin": "^3.0.4",
    "@react-native-community/masked-view": "^0.1.5",
    "axios": "^0.19.2",
    "expo": "~36.0.0",
    "expo-facebook": "~8.0.0",
    "expo-google-app-auth": "^8.0.1",
    "link": "^0.1.5",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-elements": "^1.2.7",
    "react-native-fbsdk": "^1.1.2",
    "react-native-gesture-handler": "~1.5.0",
    "react-native-google-signin": "^2.1.1",
    "react-native-link": "^4.1.0",
    "react-native-paper": "^3.6.0",
    "react-native-reanimated": "~1.4.0",
    "react-native-safe-area-context": "0.6.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-native-status-bar-height": "^2.4.0",
    "react-native-web": "~0.11.7",
    "react-native-webview": "^8.1.2",
    "react-navigation": "^4.2.2",
    "react-navigation-stack": "^2.2.2",
    "react-navigation-tabs": "^2.8.2"
  },
  "devDependencies": {
    "babel-preset-expo": "~8.0.0",
    "@babel/core": "^7.0.0"
  },
  "private": true
}

thank you all!

React Native SyntaxError ","

$
0
0

Receiving syntax error, SyntaxError: Unexpected token, expected ",". It is for the third to last line ");"

I am having trouble seeing where I need to insert the ",". I have tried in front of the ); and after. No luck. This is while I was adding the code for google sign in for ios. Would appreciate any assistance.

    render() {
        LayoutAnimation.easeInEaseOut();
        const scrollEnabled = this.state.screenHeight > height;
        return (this.state.logedin ?
            <View style={styles.container}>
                <StatusBar barStyle="light-content"></StatusBar>
                <ScrollView
                    style={{ flex: 1 }}
                    contentContainerStyle={styles.scrollview}
                    scrollEnabled={scrollEnabled}
                    onContentSizeChange={this.onContentSizeChange}
                >
                    <ImageBackground source={require("/Users/carloscraig/NoExcusasRN/screens/assets/grassbcg2.png")}
                        style={{ width: '100%', height: '100%' }}>
                        <Image source={require("/Users/carloscraig/NoExcusasRN/screens/assets/noexlogo.png")}
                            style={styles.logo}>
                        </Image>

                        <Text style={styles.greeting}>{'BIENVENIDO!'}</Text>

                        <View style={styles.errorMessage}>
                            {this.state.errorMessage && <Text style={styles.error}>{this.state.errorMessage}</Text>}
                        </View>

                        <View style={styles.form}>
                            <View>
                                <Text style={styles.inputTitle}>correo electrónico</Text>
                                <TextInput
                                    style={styles.input}
                                    autoCapitalize="none"
                                    onChangeText={email => this.setState({ email })}
                                    value={this.state.email}
                                ></TextInput>
                            </View>

                            <View style={{ marginTop: 32 }}>
                                <Text style={styles.inputTitle}>contraseña</Text>
                                <TextInput
                                    style={styles.input}
                                    secureTextEntry
                                    autoCapitalize="none"
                                    onChangeText={password => this.setState({ password })}
                                    value={this.state.password}
                                ></TextInput>
                            </View>
                        </View>

                        <TouchableOpacity style={styles.button} onPress={this.handleLogin}>
                            <Text style={{ color: "#FFF", fontWeight: "500" }}>Iniciar Sesión</Text>
                        </TouchableOpacity>

                        <SafeAreaView style={{
                            flex: 1,
                            justifyContent: 'center'
                        }}>
                            <Image style={{
                                width: 300,
                                height:300,
                                justifyContent: 'center',
                                alignSelf: 'center'
                            }} source={{uri: this.state.photo}} />
                            <Text>{this.state.name}</Text>
                            <Text>{this.state.email}</Text>
                            </SafeAreaView>:
                            <SafeAreaView style={{
                                flex: 1,
                                justifyContent: 'center',
                                alignItems: 'center'
                            }}>
                            <GoogleSigninButton
                                style={{ width: 192, height: 48 }}
                                size={GoogleSigninButton.Size.Wide}
                                color={GoogleSigninButton.Color.Light}
                                onPress={this._signIn}
                                disabled={this.state.isSigninInProgress} />
                        </SafeAreaView>

                       <TouchableOpacity
                            style={{ alignSelf: "center", marginTop: 32 }}
                            onPress={() => this.props.navigation.navigate("Register")}
                        >
                            <Text style={{ color: "#414959", fontSize: 13 }}>
                                No tienes una Cuenta? <Text style={{ fontWeight: "500", color: "#E9446A" }}>Regístrate</Text>
                            </Text>
                        </TouchableOpacity>
                    </ImageBackground>
                </ScrollView>
            </View>


        );
   }
}

Design approach for React Native app and Video editor in iOS / Android native code

$
0
0

We have a existing React Native app. We want to add Video and Image Filters/Editor features in the app. After reading and discussing, we think Video / Image Editor should be developed in iOS / Android native. Can you please suggest if we can integrate the iOS and Android native code in React Native app?

Even though react-native run-ios is success . Does not move from the splash screen. I will go crazy

$
0
0

Even though react-native run-ios is success . Does not move from the splash screen

success Successfully launched the app on the simulator In terminal. splash screen

I try to clean chash .

watchman watch-del-all 
rm -rf node_modules/ 
yarn install 
yarn cache clean


rm -rf ~/Library/Caches/CocoaPods
cd ios
rm -rf Pods/
pod install

But, it don't change.

I will go crazy

React-native Picker broken on IOS

$
0
0

I am using expo with react-native to implement a picker. When I launch it on Android the picker works perfectly but when I launch it on IOS, I get the following view. Broken picker on IOS. I am not getting any error messages and I do not want to use any other libraries.

<Picker       style={{
              width: "100%",
              height: 50
            }}
            selectedValue={this.state["country"]}
            mode="dropdown"
            onValueChange={(itemValue, itemIndex) => {
              console.log(itemIndex);
              this.setState({ country: itemValue });
            }}
          >
            {this.state["country_array"].map((item, key) => (
              <Picker.Item label={item[1]} value={item[0]} key={key} />
            ))}
          </Picker>

How to override DNS in ios with React Native? [closed]

$
0
0

My client needs an app to configure the user's DNS in iOS device with React Native. Please let me know if there is any way to do this.

Apple rejecting my app due to permission missing from Info.plist but my permissions are localized

$
0
0

So I had my keys before in the Info.plist file, but I wanted to localize them, which I did, so I created the InfoPlist.string for english and spanish. They both work. But when I attempted to upload the build to the store, it sent me a rejecting email saying that the keys are missing from the Info.plist. I removed them from there since I had them localized now. How am I supposed to do it now? If I add them back into the Info.plist, it might take those as default?

What should I do here?

Thanks in advance.

React Native - Navigate to screen - Invalid hook call

$
0
0

App.js:

import React, { Component } from 'react';
import {View,Text} from 'react-native';
import { createDrawerNavigator } from 'react-navigation-drawer';
import {createAppContainer} from 'react-navigation';

import Epics from './screens/tmp';
import Pager from './screens/Pager';

const DrawerNavigator = createDrawerNavigator({
 Home: {screen: Epics},
 Page: {screen: Pager}
},{initialRouteName: 'Home'});

const Stack = createAppContainer(DrawerNavigator);

export default class App extends Component {
  render() {
    return <Stack />;
  }
}

Trying to navigate to a screen through a custom component:

import { ActivityIndicator, Image, StyleSheet, View, TouchableHighlight } from 'react-native';
import PropTypes from 'prop-types';
import React from 'react';
import { useNavigation } from 'react-navigation-hooks';

import AuthorRow from './AuthorRow';

export default class Card extends React.Component {

  static propTypes = {
    fullname: PropTypes.string.isRequired,
    image: Image.propTypes.source.isRequired,
    linkText: PropTypes.string.isRequired,
    onPressLinkText: PropTypes.func.isRequired,
    epicId: PropTypes.string.isRequired,
  };

  state = {
    loading: true,
  };

  getNav(){
    return useNavigation();
  }

  handleLoad = () => {
    this.setState({ loading: false });
  };

  render() {
    const { fullname, image, linkText, onPressLinkText, epicId, prop } = this.props;
    const { loading } = this.state;

    return (
      <View>
        <AuthorRow
          fullname={fullname}
          linkText={linkText}
          onPressLinkText={onPressLinkText}
        />
        <TouchableHighlight onPress={() => this.getNav().navigate('Pager')} underlayColor="white">
          <View style={styles.image}>
            {loading && (
              <ActivityIndicator style={StyleSheet.absoluteFill} size={'large'} />
            )}
            <Image
              style={StyleSheet.absoluteFill}
              source={image}
              onLoad={this.handleLoad}
            />
          </View>
        </TouchableHighlight>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  image: {
    aspectRatio: 1,
    backgroundColor: 'rgba(0,0,0,0.02)',
  },
});

From above code, trying to navigate using:

import { useNavigation } from 'react-navigation-hooks';

getNav(){ return useNavigation(); }

this.getNav().navigate('Pager')

It errors our stating: Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component.

How do I navigate using "useNavigation()" or how do I get "this.props.navigation" reference in a component? (I am new to React Native, please help me understand)

Exception '-[GIDSignIn setPresentingViewController:] unrecognized selector sent to instance 0x280e898c0'

Which version does React Native support (iOS and Android)?

$
0
0

I can't find this information. Is it true that Android React Native runs on sdkMin18 and therefore makes it supported by most android versions?

Viewing all 16909 articles
Browse latest View live


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