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

FlatList rendering as blank even when the data(Array) is supplied to the component

$
0
0

I am trying to render out a list of object data using FlatList in my React Native component, however I am getting a blank screen without any errors on the console which is why it is rather difficult to get to the bottom of the issue here. The data is made available to the component using Redux-Saga approach and supplied to the FlatList which is showing up a blank screen without any errors. To double check if the FlatList is working fine I did a mockup array in component and passed to the FlatList which renders out the UI as expected. Following is the code I am using here;

=======================================================

    class Mobile extends Component {

      componentDidMount() {
        let { readPostsAction } = this.props;
        readPostsAction();
      }

      renderItem = ({ item }) => {
        return (
          <View>
            <TouchableOpacity onPress={() => this.props.navigation.navigate('HomeDetails', { item })}>
              <Card>
                <CardItem header>
                  <Text style={styles.titleHeading}>{item.title}</Text>
                </CardItem>
                <CardItem cardBody>
                  <Content style={styles.cardContainer}>
                    <CustomCachedImage
              component={FitImage}
              source={{ uri: contentURL(item.attachments[0].url) }}
              style={{ width: width, height: 200 }}
                    />
                    <HTML tagsStyles={bodyText} html={reduceStringLength(contentText(item.excerpt))} />
                  </Content>
                </CardItem>
              </Card>
            </TouchableOpacity>
          </View>
        )
      }

      keyExtractor = (item, index) => item.id;

      render() {
        const { dataSource } = this.props;
        console.log('this.props', this.props);
        return (
          <View>
            <FlatList
              data={dataSource}
              keyExtractor={this.keyExtractor}
              renderItem={this.renderItem}
            />
          </View>
        );
      }
    }

    function mapStateToProps({ launchAppReducer }) {
      return {
        isLoading: launchAppReducer.isLoading,
        dataSource: launchAppReducer.data
      }
    }

    export default connect(mapStateToProps, { readPostsAction: actions.readPostsAction })(Mobile);

=======================================================

Here is the screenshot of the console Screenshot showing that the data is available in the component.


AppStore new app review with in-app purchase

$
0
0

I have a brand new app which contains an in-app purchase. I am trying to understand a correct order of the review. What has to be reviewed first: a brand new app or an in-app purchase

Firstly I tried to submit both binary and in-app purchase at the same time but got rejected. Apple's testers got 'undefined' price on my payment screen. However on all my devices and simulators price is loaded correctly and is shown in local currency. So I decided that maybe price is not working for Apple's testers because in-app purchase was not approved yet.

Yesterday I submitted my in-app purchase only for review without submitting a new binary. Right now in-app purchase is "waiting for review" and binary is still "rejected" with old unresolved issue.

Need an advice if I am doing this the correct way.

setState not working properly in release mode React native iOS

$
0
0

I'm fetching some data from a server to load it to my app, my app doesn't load until the app loads all the data, it works perfectly in the debug mode, but when I have to test it on release mode, I have to reload it in order to make it work, and that is not the idea. Here's my code:

import React, { Component } from 'react';
import { Alert, NetInfo, View, Text, AsyncStorage, TouchableWithoutFeedback, Linking, Platform } from 'react-native';
import { Actions } from 'react-native-router-flux';
import Router from './Router';
import OnBoarding from './components/OnBoarding';
import Loading from './components/Loading';
import OneSignal from 'react-native-onesignal';
import axios from 'axios';
var DeviceInfo = require('react-native-device-info');

class App extends Component {

    constructor(props) {
        super(props);
        this.state = {
          usage: '',
          categories_hum: [],
          videoshum: [],
          categories_nov: [],
          novedades: [],
          tiendas: [],
          promociones: [],
          listadoCodigos: [],
          token: "",
          listadoCodigosRecibido: true,
          terminos: '',
          notFirst: false
        };
        this.changeUsage = this.changeUsage.bind(this);
      }

    onIds(device) {
      AsyncStorage.setItem('playerId', device.userId);
    }

    onOpened(openResult) {
     if(openResult.notification.payload.additionalData != undefined) {
      var opc = openResult.notification.payload.additionalData.opc;
      if(opc == 2) {
        opc = "2";
        AsyncStorage.setItem('opcion', opc);
      } else if(opc == 1) {
        opc = "1";
        AsyncStorage.setItem('opcion', opc);
      }
     }
    }


    componentWillMount() {
      OneSignal.addEventListener('ids', this.onIds);
      OneSignal.addEventListener('opened', this.onOpened);
    }

    componentDidMount() {
      NetInfo.isConnected.fetch().then(isConnected => {
           if(!isConnected) {
             Alert.alert (
               'No hay conexion',
               'No hay conexion a internet, debe poseer una conexion WiFi o celular para usar FerretotalApp'
             );
           }
        });

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/categoria-hum?per_page=100')
        .then(response => response.json())
        .then(
            response => this.setState({ categories_hum: response})
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/videoshum?per_page=100')
        .then(response => response.json())
        .then(
            response => this.setState({ videoshum: response })
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/tienda_acf?per_page=100')
        .then(response => response.json())
        .then(
            response => this.setState({ tiendas: response })
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/categorianovedades?per_page=100')
        .then(response => response.json())
        .then(
            response => this.setState({ categories_nov: response })
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/ferretotalnovedades?per_page=100')
        .then(response => response.json())
        .then(
            response => this.setState({ novedades: response })
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/promociones_activas?hola=1')
        .then(response => response.json())
        .then(
            response => this.setState({ promociones: response })
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/listado_codigos_usuario?deviceID="'+DeviceInfo.getUniqueID()+'"')
        .then(response => response.json())
        .then(
          response => this.setState({ listadoCodigos: response, listadoCodigosRecibido: true})
        );

        fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/terminos_condiciones?hola=1')
        .then(response => response.json())
        .then(
          response => this.setState({ terminos: response})
        );

        AsyncStorage.getItem('usage').then((result) => {
               if(!result){
                 this.setState({usage: "firstTime"});
               }else{
                 this.setState({usage: result});
               }
               //al colocar esto hara q salga siempre el onboarding
               //AsyncStorage.removeItem("usage");
             });

             AsyncStorage.getItem('notFirst').then((result) => {
               if(!result){
                 this.setState({notFirst: false});
                } else {
                   this.setState({notFirst: false})
                  }
               });

              AsyncStorage.getItem('token').then((value) => {
               if(!value){
                 var DeviceID = DeviceInfo.getUniqueID();
                 fetch('https://ferrretotalcom.kinsta.com/wp-json/wp/v2/recibir_token?deviceID="'+DeviceID+'"')
                 .then((response) => response.json())
                 .then((response) => {
                   if(response[0]){
                     AsyncStorage.setItem('token',response[0].access_token);
                     this.setState({token: response[0].access_token});
                   }
                 })
               } else {
                 this.setState({token: value})}
             });
             AsyncStorage.setItem('newCode',"false");
    }

    componentWillUnmount() {
      OneSignal.removeEventListener('ids', this.onIds);
      OneSignal.removeEventListener('opened', this.onOpened);
    }

    changeUsage(e) {
      this.setState({usage: "notFirst"});
      this.setState({notFirst: true});
    }

    render(){
      /*alert(this.state.categories_hum.length + "" + this.state.videoshum.length + "" + this.state.promociones.length
      + "" + this.state.novedades.length + "" + this.state.categories_nov.length + "" + this.state.tiendas.length + "" + this.state.listadoCodigosRecibido + "" + this.state.terminos.length) */

          if(this.state.categories_hum.length && this.state.videoshum.length && this.state.promociones.length
          && this.state.novedades.length && this.state.categories_nov.length && this.state.tiendas.length && this.state.listadoCodigosRecibido && this.state.terminos.length) {
             if(this.state.usage.length && this.state.usage == "firstTime"){
               //al colocar esto solo saldra el onboarding la primera vez
               AsyncStorage.setItem('usage', "notFirst");
               AsyncStorage.setItem('notFirst', true)
               //al colocar esto, guardara la fecha de instalacion de la aplicacion (realmente la primera vez que se mete)

                AsyncStorage.getItem('installed').then((result) => {
                if(!result) {
                  var date = new Date();
                  date = date.toString();
                  AsyncStorage.setItem('installed', date);
                }
              });

               return (
                  <OnBoarding changeUsage={this.changeUsage} terminos={this.state.terminos}/>
               );
             } else if(this.state.usage == "notFirst"&& this.state.notFirst == false) {
               return(
                <OnBoarding changeUsage={this.changeUsage} terminos={this.state.terminos} notFirst={true}/>
               );
            } else if(this.state.usage == "notFirst"&& this.state.notFirst) {
                    return (
                    <View style={{flex:1}}>
                        <Router
                            categories_hum={this.state.categories_hum}
                            videoshum={this.state.videoshum}
                            categories_nov={this.state.categories_nov}
                            novedades={this.state.novedades}
                            tiendas={this.state.tiendas}
                            listadoCodigos={this.state.listadoCodigos}
                            promociones={this.state.promociones}
                            token={this.state.token}
                            terminos={this.state.terminos}
                        />
                    </View>
                );
              }
          } else{
            return (
                <Loading/>
            )
        }
    }
}

export default App;

As you can see, I'm fetching all the data I need in the "ComponentDidMount" method, then I store the JSON data in multiple states and pass it to the screens I need, the thing is that in release mode, the states don't have anything after it "loads" and it only happens the first time you open the app and only in release mode, I check the response from fetch and it is ok, it brings the data. I have tried lot of things but I can't still figured out what it is since it works well in debug mode. Please if you have any ideas, you can tell me.

how to do autofill credit card with react native on iOS?

$
0
0

username / password can be auto filled. Is it possible to autofill credit card info, like name, card number, expiry date and CCV?

Disable application badge icon on receiving notification in ios

$
0
0

I am using react-native-applozic-chat for handling chats in my react-native app. My question is there any way to prevent the app badge icon from appearing on app icon after receiving any chat notification? I want to disable it specifically in ios because it does not appear in android.

gl-react-native not displaying image on physical iOS device

$
0
0

I'm trying to get the saturation example from gl-react: Contrast/Saturation/Brightness example working on an iphone, but for some reason the image only displays on an iOS simulator and not a real device.

This is what is shown on an iphone SE simulator running iOS 10.3 (Everything works perfectly, as in the example). enter image description here This is what is shown on an actual iphone SE running iOS 10.3 enter image description here

And this is the code

 /**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import { Shaders, Node, GLSL } from 'gl-react';
import {
  Platform,
  StyleSheet,
  Text,
  View,
  Slider
} from 'react-native';
import { Surface } from 'gl-react-native';

const shaders = Shaders.create({
  Saturate: {
    frag: GLSL`
  precision highp float;
  varying vec2 uv;
  uniform sampler2D t;
  uniform float contrast, saturation, brightness;
  const vec3 L = vec3(0.2125, 0.7154, 0.0721);
  void main() {
    vec4 c = texture2D(t, uv);
    vec3 brt = c.rgb * brightness;
    gl_FragColor = vec4(mix(
      vec3(0.5),
      mix(vec3(dot(brt, L)), brt, saturation),
      contrast), c.a);
  }
  `
  }
});

export const Saturate = ({ contrast, saturation, brightness, children }) =>
  <Node
    shader={shaders.Saturate}
    uniforms={{ contrast, saturation, brightness, t: children }}
  />;



export default class App extends Component<{}> {
  state = {
    contrast: 1,
    saturation: 1,
    brightness: 1
  }

  render() {
    const { contrast, saturation, brightness } = this.state;

    const filter = {
      contrast,
      brightness,
      saturation
    }

    return (
      <View>
        <Text style={styles.header}>
          SaturateGL
        </Text>
        <Surface style={{ width: 300, height: 300 }}>
          <Saturate {...filter}>
            {{ uri: "https://i.imgur.com/uTP9Xfr.jpg" }}
          </Saturate>
        </Surface>
        <Slider
          minimumValue={0}
          maximumValue={4}
          step={0.01}
          value={ contrast }
          onValueChange={ contrast => this.setState({ contrast }) }>
        </Slider>
        <Slider
          minimumValue={0}
          maximumValue={4}
          step={0.01}
          value={ saturation }
          onValueChange={ saturation => this.setState({ saturation }) }>
        </Slider>
        <Slider
          minimumValue={0}
          maximumValue={4}
          step={0.01}
          value={ brightness }
          onValueChange={ brightness => this.setState({ brightness }) }>
        </Slider>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  header: {
    fontSize: 24,
    textAlign: 'center',
    padding: 10,
  },
});

Repo Here

I'm running

  • gl-react@3.13.0
  • gl-react-native@3.13.0
  • react-native-webgl@0.70

and react-native-webgl is set up properly (I've linked the libRNWebGL.a and removed the libGPUImage.a in xcode as per the install instructions).

I'm quite new to react-native, so probably I've done (or worse yet, not done) something, which is a bit daft. But if anyone can help point out why this is happening, I'd be most grateful. This is really annoying me.

Thanks

How to create a React Native component using ARKit / a swift ViewController?

$
0
0

We have a project based on the swift based ARKit example Capturing Body Motion in 3D from the WWDC 2019. And we have a React Native app using native swift components, following the great instructions from Swift in React Native - The Ultimate Guide. Now we want to implement the view from the ARKit example as a react-native component, but I just don't find out how to do this.

The ARKit example uses a UIViewController with ARSessionDelegate, which means we have to wrap more than a simple view in the component.

I found some answers on how to present a native UIViewController in React Native, but could not translate this solution into swift code and could not get it to work with the ARKit example. Does anybody of you have an idea how to wire this up?

Error with exit code 1 while building react native 0.61.4 app with XCode 11.2.1 on a physical device

$
0
0

I am using XCode 11.2.1 (latest now) to build my iOS react native app (react-native@0.61.4) The build succeed on any simulator but fails on any physical device (no specific OS version) Is there any special configuration for the new XCode - even the react-native template app have the same issue - exit with code 1.


In Ios, download stops on locking of device. Is there any way the download continues in background?

$
0
0

In ios, When we lock the screen the device goes into sleep mode and stops the download process and disrupts it. I used the react-native-keep-awake dependency but locks the screen anyway and is not a permanent solution. Is there any solution for this?

Fabric : /ios/Pods/Fabric/run”: No such file or directory

$
0
0

using pod to install fabric but getting /ios/Pods/Fabric/run”: No such file or directory, i added run script in

“${PODS_ROOT}/Fabric/run”  <API KEY> <S KEY>” 

show environment variable in build log is checked ,

whats issue not able to get ,

here is pod version

pod 'Fabric', '~> 1.7.6'
pod 'Crashlytics', '~> 3.10.1'

react-native ios Podfile issue with "use_native_modules!"

$
0
0

In my react-native project (react-native@0.60) in the ios/ dir I run pod install and get this error:

[!] Invalid `Podfile` file: no implicit conversion of nil into String.

 #  from /Users/coryrobinson/projects/hhs2/ios/Podfile:37
 #  -------------------------------------------
 #  
 >    use_native_modules!
 #  end
 #  -------------------------------------------

I haven't added or changed anything in this Podfile - it's all react-native generated. (I'm not experienced in iOS dev so this might be a simple fix, I just don't know what to look for :-|) Thanks for any help!

Here is my Podfile

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'hhs2' do
  # Pods for hhs2
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
  pod 'RNFS', :path => '../node_modules/react-native-fs'

  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 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  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'

  target 'hhs2Tests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'hhs2-tvOS' do
  # Pods for hhs2-tvOS

  target 'hhs2-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

How to access the iOS user defaults in React Native?

$
0
0

I'm trying to access my iOS UserDefaults in my React Native app. I tried this with Settings from react-native.

I set the user defaults like this (native in Swift)

userDefaults?.set("test", forKey: "test")

and also tried it like this

UserDefaults.standard.set("test", forKey: "test")

And I'm trying to log it like this in my react-native app

import {Settings} from 'react-native';

const test = Settings.get('test'); 
console.log(test);

This logs undefined

I can't find a proper example anywhere, so I hope someone can help me out here.
I need to use the watchKeys() method for the purpose of my app, so react-native-user-defaults is not a solution in my case.

Thanks in advance!

react-native-orientation in iOS

$
0
0

I have a project in React Native, and I need lock a orientation a specific view in landscape orientation. But, the code don't work and the screen loop tilting. I find one answer for the problem very similar with mine. But, the solution propose don't work. I already search very hard for one solution.

Sorry for bad english. Someone can help?

this is a result of my code

This is my code

import Orientation from 'react-native-orientation-locker';

const App: () => React$Node = () => {
  function _onOrientationDidChange(orientation) {
    if (orientation == 'PORTRAIT') {
      Orientation.lockToLandscapeLeft();
    }
    console.log(orientation);
  }

  React.useEffect(a => {
    Orientation.lockToLandscapeLeft();
    Orientation.addOrientationListener(_onOrientationDidChange);
  }, []);
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        ...
      </SafeAreaView>
    </>
  );
};

InvalidRegistration for React Native iOS

$
0
0

I'm building React Native App. I have used a react-native-notification library to add the Notification features.

My Andriod app can generate token and received notifications from firebase but for iOS app, the token is generated but when a message is sent to this token id nothing happened instead I am getting an error.

"error": "InvalidRegistration"

await NotificationsIOS.addEventListener('remoteNotificationsRegistered', onPushRegistered);
  await NotificationsIOS.addEventListener('remoteNotificationsRegistrationFailed', onPushRegistrationFailed);
  await NotificationsIOS.requestPermissions();

function onPushRegistered(deviceToken) {
    // TODO: Send the token to my server so it could send back push notifications...
    console.log("Device Token Received", deviceToken);
  }

I used this code to get Device Token on iOS the token is generating but i think it is not a vlaid FCM token. 45f41b17e16b5970fe35.......8222b01289580bae87ba35d2b2bc72b

{
  "data": {
    "title": "sample Title",
    "content": "sample text",
    "key": "Im the key"
  },
  "to": "ce4a46370d7c4060b0a4dd.........47de821d0bc1767f124a2fa157afe"
}

But when i send the FCM message to this token id it gives me above error. I have also added the APN's certificates to the firebase. I can generate the local notifications using this library on ios and the remote andriod notification is also working properly. Kindly help me to get it fixed as i don't want to use any other library thanks.

XCode 11.2.1 codesign error when building react native on a physical device

$
0
0

I am using XCode 11.2.1 (latest now) to build my iOS react native app (react-native@0.61.4) The build succeed on any simulator but fails on any physical device (no specific OS version) Is there any special configuration for the new XCode - even the react-native template app have the same issue - exit with code 1.


React Native - How to make KeyboardAvoidingView inside a ScrollView work for all devices?

$
0
0

enter image description here

I am building a chat UI in react native and am having an issue with using KeyboardAvoidingView inside of a ScrollView. When selecting the TextInput the height between the input field and keyboard seems to vary based on the device I am using. How do I standardize this so that it works equally for all devices?

import React from 'react'
import { StyleSheet, View, Text, TextInput, ScrollView, KeyboardAvoidingView, Platform } from 'react-native'
import Message from './message'


export default class Messages extends React.Component {
  static navigationOptions = ({ navigation }) => ({
    headerTitle: 'Messages',
    headerStyle: {
      backgroundColor: 'rgb(0,0,0)',
    },
    headerTitleStyle: {
      fontSize: 20,
      color: 'rgb(255,255,255)'
    },
    headerTintColor: 'rgb(0,122,255)',
  })

  state = {
    messages: [
      {
        message: 'yeah its not working',
        userId: 1,
        userName: 'Client'
      },
      {
        message: 'what isnt working...',
        userId: 2,
        userName: 'Sean'
      },
      {
        message: 'it, all of it',
        userId: 1,
        userName: 'Client'
      },
      {
        message: 'were on it',
        userId: 3,
        userName: 'Matt'
      },
      {
        message: 'fjdklsajfklsdjafkdjslkafjkdsjal;fdks;lajfdklsjldjskfja;sfjasdfjasdjlkfaj',
        userId: 3,
        userName: 'Matt'
      },
      {
        message: 'great!',
        userId: 1,
        userName: 'Client'
      },
      {
        message: 'blah',
        userId: 1,
        userName: 'Client'
      },
      {
        message: 'derp',
        userId: 2,
        userName: 'Sean'
      },
      {
        message: 'merh!',
        userId: 2,
        userName: 'Sean'
      },
       {
        message: 'help pls',
        userId: 2,
        userName: 'Sean'
      },
    ]
  }

  renderMessages = (messages) => {
    return messages.map((data, i) => <Message data={data} key={i}/>)
  } 

  render() {
    return (
      <ScrollView 
        style={styles.container}
        ref={ref => this.scrollView = ref}
        onContentSizeChange={(contentWidth, contentHeight)=> {this.scrollView.scrollToEnd({animated: true})}}
      >
        <KeyboardAvoidingView
          behavior={Platform.OS == 'ios' ? "position" : null}
        >
          <View>
              {this.renderMessages(this.state.messages)}
              <View style={styles.textBox}>
                <TextInput 
                  style={styles.textInput}
                  placeholder='Reply...'
                  placeholderTextColor={'rgb(216,216,216)'}
                  returnKeyType='done'
                  autoCapitalize='none'
                  selectionColor='#3490dc'
                  multiline={true}
                  blurOnSubmit={true}
                />
              </View>  
          </View>
        </KeyboardAvoidingView>
      </ScrollView>
      )
  }
}



const styles = StyleSheet.create({
    container: {
        //flex: 1,
        backgroundColor: 'rgb(0,0,0)'
    },
    textInput: {
        color: 'rgb(255,255,255)',
        fontSize: 18,
    },
    textBox: {
      borderColor: '#242F39',
      borderWidth: 2,
      borderRadius: 2, 
      padding: 10,
      paddingLeft: 16,
      marginTop: 10,
      backgroundColor: '#0A151F'
    }
})

How to open other application from my application

$
0
0

I am writing code to launch other applications from my react native application for android and ios.

Using Linking form react native I am able to redirect to Play Store/App Store but

How can I launch App if it's already installed?

* I am getting the list of the app's from server

enter image description here

Linking.openURL('https://play.google.com/store/apps/details?id=com.example.myapp&hl=en')

Is there any way that I can launch the app if it's installed else redirect to App store/play store with respect to the platform?

Reference:react-native-app-link

React Native ios picker is always open

$
0
0

I have two pickers on my screen. Whenever I navigate to the screen in iOS app I find that the pickers are always open and all options are visible.

enter image description here

It works perfectly fine in Android where the options are visible only after we click on the picker.

Can somebody suggest a solution to fix this in iOS?

No video selection screen when using React Native Web View

$
0
0

enter image description here

enter image description here

Vue.JS

<templates>
<input type="file" accept="video/*" @change="onChange"></input>
<templates>

When I open the vuejs code in ios safari browser, it is attached after selecting video in photo library, video selection + compression. (photo library -> video selection -> compressing -> get video file)

But when you open it in React Native WebView, it's done right in the photo library, and the video selection screen doesn't appear. The file size is taken as zero bytes. (photo library -> get video file(0 byte))

I added permission to info.plist.

  • Camera Usage Description
  • Microphone Usage Description
  • Photo Library Usage Description

What's wrong?

How do I use the DeckSwiper element in NativeBase without getting "Element type is invalid" error?

$
0
0

I'm using NativeBase's DeckSwiper (docs, code) in a view and getting an error every time:

Warning: React.createElement: type should not be null, undefined, 
boolean, or number. It should be a string (for DOM elements) or a 
ReactClass (for composite components). Check the render method of `CardSwiper`.

This markup works:

<View flex>
    <DeckSwiper dataSource={cards} renderItem={(item) => {
        console.log(item);
        return (
            <Text flex>{item.text}</Text>
        )
    }}/>

But subbing in this markup for the Text (from their site) fails, with the above error:

<Card style={{
    elevation: 3
}}>
    <CardItem>
        <Thumbnail source={item.image}/>
        <Text>{item.text}</Text>
        <Text note>NativeBase</Text>
    </CardItem>
    <CardItem>
        <Image style={{
            resizeMode: 'cover',
            width: null
        }} source={item.image}/>
    </CardItem>
    <CardItem>
        <Icon name="ios-heart" style={{
            color: '#ED4A6A'
        }}/>
        <Text>{item.name}</Text>
    </CardItem>
</Card>

I can't figure out if I'm using it wrong or the docs are off or this is a bug. What's the issue here?

Viewing all 16566 articles
Browse latest View live


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