react native - Use a method in another class and navigation

I am coding an application that is neccessary to login users and I am experiencing a problem.I have in my App component a getUser () method that I would like to call from other components. I also have a Login () method that allows you to navigate to another page. Only the problem is that I can not export the StackNavigator and App at the same time. Would there be a way to export the StackNavigator and my function? Or an other solution that would solve my problem?class App extends Component<{}> { //get the user and return it _getUser...Read more

Deep linking using react native expo?

How to get deep linking url using react native expo?I tried as per Expo documentation using scheme but it is not working for =>{ "expo": { "scheme": "myapp" }} Thanks!...Read more

react native - Getting this Error: .android/repositories.cfg could not be loaded

File /Users/MyName/.android/repositories.cfg could not be loaded.FAILURE: Build failed with an exception.What went wrong:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApk'. A problem occurred configuring project ':urbanairship-react-native'. Could not resolve all dependencies for configuration ':urbanairship-react-native:_debugPublishCopy'. Could not find any version that matches com.facebook.react:react-native:[0.40,). Versions that do not match: 0.20.1 ...Read more

Sticky Views while react-navigation

Im trying to build a mobile app where we have a constant header bar throughout the app. I have the body where I have buttons.. Each button navigates to a screen. I need the header bar in every screen but I dont wish to repeat the code in all screens. I dont intend to use TabNavigator either. Is there any alternative?? in image1 and image 2 the bar with the search,cart and offerzone tag remains same. The rest changes..I need this behaviour without repeating the header code in both screens....Read more

reactive programming - React-Native: How to make image array

I have a screen on which I want to have 4 images. How can I make it so that when I click on the image it goes to the next one from the array (I suppose that's how it would be made). I also wanted to have buttons to go to the next image or go back to the previous one in addition to the touch.I hope someone could assist me with this. I am not sure how to approach it. I want to find the best way to implement it. Thank you ! UPDATE:Everything works thanks to Codesingh's answer !...Read more

reactive programming - React-Native: How to change background second action

the problem is quite simple I think, but I can't seem to figure it out. I am using the react-native-router-flux library and the NativeBase library for the buttons. This is my code: <Button transparent onPress={Actions.MainOne } style={{ width: 50, height: 50 }} > <Text>Option1</Text> </Button> <Button transparent onPress={Actions.MainTwo} style={{ width: 50, height: 50 }} > <Text>Option2</Text> </Button>I want to change the background color of the button whenever i press it a...Read more

react native - TypeError: expected dynamic type `string', but had type `int64' while getting text from TextInout

Here is my I tried a but not able to resolve this simple one export default class LoginScene extends Component { constructor(props) { super(props); this.state = { userid: '', password: '', }; } componentWillMount() { // this.fetchData(); } veryfyLogin() { fetch(LOGIN_URL) .then((response) => { if (response.status === 200) { var navigator = this.props.navigator; navigator.push({ id: '...Read more

react native - How to check if a user device is using fingerprint/face as unlock method. [ReactNative] [Expo]

I'm using ReactNative based on Expo Toolkit to develop a App and I want know how I can check if the user is using the fingerprint (TouchID on iPhone) or face detection (FaceID on iPhone X>) to unlock the device.I already know how to check if device has the required hardware using Expo SDK, as follow:let hasFPSupport = await Expo.Fingerprint.hasHardwareAsync();But I need check if the user choose the fingerprint/face as unlock method on your device, instead pattern or pin.Thanks...Read more

PayPal adaptive payment flow on React Native

I'm creating an app with react native that have a payment module with credit card and PayPal as payment module. The payment is automatically transferred to a vendor account subscribed in our platform(Buyer -> Platform -> Vendor).I already successfully created this payment flow in the credit card payment module using stripe as a payment gateway but i didn't find a way to do it with PayPal. Here's a list of what i tried:Adaptive payment: the problem with PayPal adaptive payment is that's it's not mobile friendly, the standard checkout page is not...Read more

react native push notification sound

I am trying to add sound to my local push notification.I am using RN 0.45.1 andreact-native-push-notifications 3.0.0I manage to schedule notification in iOS and Android with default sound.I did not manage to add custom sound.I have sounds file of type mp3.I tried the following:place the file in my project folder:'/src/assests/sounds/sound.mps' (a folder inside my project)and than:import notificationSound from '../src/assests/sounds/sound.mps';PushNotification.localNotificationSchedule({ message: 'Test message', date: new D...Read more

render every even ListItem backgroundColor grey and every odd one's white in React-Native

For my react-native application I'm using ListItem. I think there should be some way that I can be able to render my ListItems' backgroundColor automated one after another, just like in picture.and Here is my List code right now.<List> <ListItem> <Body> <Text style={{fontSize: 10, fontWeight: 'bold'}}>Lead Info Update: Updated lead info bar . 2017-11-15 14:27:02</Text> <Text style={{fontSize: 15}} note><Icon style...Read more