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

Show keyboard programmatically using React native

$
0
0

How do I show Keyboard for TextInput programmatically using react native? Using a ScrollView, tapping between TextInput causes the keyboard to be dismissed. I want to show the Keyboard again using onFocus method of TextInput. Anyway to accomplish this?


Pick multiple images in react native Expo with Imagepicker

$
0
0

It seems like Expo only supports imagepicker for selecting one image rather than multiple images. Is there any way to pick multiple images without ejecting expo or starting new react-native-init?

Lexical or Preprocesser issue: Xcode

$
0
0

I am coding a basic React Native app and am getting a lexical or preprocessor issue in Xcode. I tried pod deintegrating and pod installing, yet the error persisted. I also tried react-native run-ios instead of using Xcode, but it didn't work. Here is the error:

enter image description here

Here is my podfile:

platform :ios, '9.0'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'target 'LocalMainStreet' do  # Pods for LocalMainStreet  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'  # add the Firebase pod for Google Analytics  pod 'Firebase/Analytics'  pod 'Firebase/Core'  pod 'Firebase/Auth'  pod 'Firebase/Crash'  pod 'Firebase/Database'  pod 'FirebaseFirestore'  pod 'Firebase/Messaging'  pod 'Firebase/Performance'  pod 'Firebase/Storage'  # add pods for any other desired Firebase products  # https://firebase.google.com/docs/ios/setup#available-pods  pod 'Stripe', '~> 14.0.0'  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false  pod 'Permission-Camera', :path => '../node_modules/react-native-permissions/ios/Camera.podspec'  pod 'react-native-camera', :path => '../node_modules/react-native-camera'  pod 'RNPermissions', :path => '../node_modules/react-native-permissions'  pod 'react-native-webview', :path => '../node_modules/react-native-webview'  pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'  target 'LocalMainStreetTests' do    inherit! :search_paths    # Pods for testing  end  use_native_modules!end

Thanks.

I'm confused to choose between flutter, react native and iOS and Android

$
0
0

I have an app which I have to develop or get developed. I'm really confused between react native and flutter, which to choose and why. I already know that flutter is far better in performance than react native but it doesn't have a developer community and is immature. I want to know if its immature then in what sense. I have thought of another approach too. I can also hire an android and an iOS developer, I know the cost rises but it doesn't gives issues like react and flutter. Kindly guide me why should I choose react native or flutter or go separately with android and iOS, with reasons. Thanks!

Add Review Information screenshots in apple store?

$
0
0

I'm trying to add in-app purchase in my ios App "react native".But in App store should i add screenshots in Review Information sections, So what's should i add here?shot

and I use 'react-native-iap',

when I call getProducts() it returns empty array so how can i fix it?

Edit

after a couple of days Sadly I just using Testflight and it takes a lot of time to debug!!

So i just found a friend who has an iPhone and tests it,It works and Buys successfullyBut now he's very busy So

I just want when users buy products successfully Dispatch an action to change something in the app 'access to full features' and send a request to our API.

So how can i know if this user buys successful or not?

here's my code

getProduct = async () => {    try {      await RNIap.initConnection();      // console.log('init?', init);      const availablePurchases = await RNIap.getProducts(items);      console.log('availablePurchases', availablePurchases);      this.setState({        availablePurchases,      });    } catch (err) {      // console.warn(err);      Alert.alert('Error purchase available', JSON.stringify(err));    }  };  requestSubscription = async sku => {    try {     let req = await RNIap.requestSubscription(sku);    // is here should i check    // if (req) dispatch action?    } catch (err) {      Alert.alert(err.code, err.message);    }  };

React Native Expo Building Javascript Bundle stuck at 99

$
0
0

I'm running my react-native app using expo on my mobile.

However, when I start the packager and connect to expo app on my mobile, it's stuck at 99% for building javascript bundle process.

There has been no code change to cause this.

I have tried re-installing my node modules and restarting my packager after cleaning cache.

What is causing this issue?

React Native Send sms within the app

$
0
0

I want to send sms to multiple numbers without opening to default messaging app.I try to use react-native-sms-x but its not maintained and my project just stuck at compiling.Also I used react-native-sms but it open default Messaging App filled with one user number and message body and had to click send button of it too.

react-native link ios to android migration

$
0
0

I am looking to migrate an existing react-native iOS app (with quite a lot of dependencies) to android and none/few of the react-native link commands have been executed in the context of android,

  1. Is there either a way to link all?
  2. Or, any tools that can take the iOS ios/Podfile file and generate the android equivalent from it?

Linking.getInitialURL() is not being cleared after used for deeplink

$
0
0

I've had this problem for like 2 weeks. I used Wix's Navigation for navigating around the app. I followed this tutorial for implementing the deeplink/universal link.

I have a base class called BaseScreen where I keep all the deeplink handler like in the tutorial. This BaseScreen would looks like this:

componentDidMount(){    // this handles the case where the app is closed and is launched via Universal Linking.    Linking.getInitialURL()        .then((url) => {          if (url) {            // Alert.alert('GET INIT URL','initial url  '+ url)            this.resetStackToProperRoute(url)          }        })        .catch((e) => {})   // This listener handles the case where the app is woken up from the Universal or Deep Linking   Linking.addEventListener('url', this.appWokeUp);  }  componentWillUnmount(){    // Remove the listener    Linking.removeEventListener('url', this.appWokeUp);  }  appWokeUp = (event) => {    // this handles the use case where the app is running in the background and is activated by the listener...    // Alert.alert('Linking Listener','url  '+ event.url)    this.resetStackToProperRoute(event.url)  }  resetStackToProperRoute = (url) => {    // grab the trailing portion of the url so we can use that data to fetch proper information from the server    let trailing = url.slice(url.lastIndexOf('=') + 1, url.length)    // go to the desired screen with the trailing token grabbed from the url    this.props.navigator.resetTo({      screen: 'NewPassword',      overrideBackPress: true,      passProps: {        token: trailing      },      animated: true,      animationType: 'fade',      navigatorStyle: {      navBarHidden: true,  }})  }

When the app launch, it'll show the screen LoginScreen which extends the BaseScreen above. After killing the app, click the url from the mail, the app launches LoginScreen first, then it'll redirect to the screen NewPassword, and after everything has done, I'll redirect back to LoginScreen by:

this.props.navigator.resetTo({  screen: 'LoginScreen',  animated: true,  overrideBackPress: true,  animationType: 'fade',  navigatorStyle: {    navBarHidden: true,  }})

But the Linking.getInitialURL() of the LoginScreen still receive the old url, so it'll redirect to NewPassword again, and it's a loop.

I've also tried to pass: passProps: {} option when resetTo the LoginScreen but no luck.

I guess the only way to fix it is to clear the initialUrl manually after everything's done in NewPassword screen. The listener for the BaseScreen should be there because if I don't kill the app (just minimize it), the listener should be running to navigate to NewPassword.

Wix's navigation has a doc for Deeplink, I tried putting method onNavigatorEvent(event) into the BaseScreen but it doesn't get called. I don't know if I miss something.

Thank you for your time. Any idea would be appreciated

How to restrict a url in react-native

$
0
0

I am making an app in RN.

I just signed up for Mapbox and it says make your token more secure by adding url restrictions.

How can we have url restrictions for app? (or can we even have?)

enter image description here

Unrecognized font family w React Native 62 on iOS only

$
0
0

Android is working fine - I have a Text component <Text style={styles.orText}>{'HELLO'}</Text> and style with fontFamily: 'SourceSansPro-SemiboldItalic' defined. On iOS I get the error [error][tid:com.facebook.react.ShadowQueue][RCTFont.mm:316] Unrecognized font family 'SourceSansPro-SemiboldItalic'.

If I change that style to SourceSansPro-Semibold on iOS I get no error but the text does not render at all. And I have a Button component from rn-elements that renders 'SourceSansPro-Semibold' correctly.

I have all the font .ttf files added to my project, they are all in Copy Bundle Resources as well as added to Info.plist under Fonts Provided by Application. Have done multiple build cleans and also tried switching to Legacy Build System. I'm running the app from Xcode but I've also tried running react-native run-is and get same font error. I have code running in App Delegate to report the fonts and it shows truncated names for anything Italic:

2020-05-26 10:57:35.426495+0200[97197:8029221] Source Sans Pro2020-05-26 10:57:35.426871+0200[97197:8029221]  SourceSansPro-BlackIt2020-05-26 10:57:35.427183+0200[97197:8029221]  SourceSansPro-SemiboldIt2020-05-26 10:57:35.427585+0200[97197:8029221]  SourceSansPro-LightIt2020-05-26 10:57:35.427993+0200[97197:8029221]  SourceSansPro-BoldIt2020-05-26 10:57:35.428413+0200[97197:8029221]  SourceSansPro-Light2020-05-26 10:57:35.428764+0200[97197:8029221]  SourceSansPro-ExtraLightIt2020-05-26 10:57:35.429126+0200[97197:8029221]  SourceSansPro-Regular2020-05-26 10:57:35.429549+0200[97197:8029221]  SourceSansPro-It2020-05-26 10:57:35.429852+0200[97197:8029221]  SourceSansPro-ExtraLight2020-05-26 10:57:35.430232+0200[97197:8029221]  SourceSansPro-Bold2020-05-26 10:57:35.430571+0200[97197:8029221]  SourceSansPro-Semibold2020-05-26 10:57:35.430948+0200[97197:8029221]  SourceSansPro-Black2020-05-26 10:57:44.341 [error][tid:com.facebook.react.ShadowQueue][RCTFont.mm:316] Unrecognized font family 'SourceSansPro'2020-05-26 10:58:11.447 [error][tid:com.facebook.react.ShadowQueue][RCTFont.mm:316] Unrecognized font family 'SourceSansPro'2020-05-26 11:00:43.704 [error][tid:com.facebook.react.ShadowQueue][RCTFont.mm:316] Unrecognized font family 'SourceSansPro-SemiboldItalic'2020-05-26 11:00:47.150 [error][tid:com.facebook.react.ShadowQueue][RCTFont.mm:316] Unrecognized font family 'SourceSansPro-SemiboldItalic'

Any ideas?? Xcode 11.4.1 with RN 62.2. Happens on device as well as simulator. TIA

TypeError: undefined is not an object (evaluating '_rxjs.queueScheduler.constructor')

$
0
0

We have developed a react-native application using react-redux in ubuntu. We are trying to build an IPA from a mac system using the same code.but we are unable to run the application and getting an error in the simulator

enter image description here

How to fix"AIRMap" was not found in the UIManager error in react native?

$
0
0

Unhandled JS Exception: Invariant Violation: requireNativeComponent: "AIRMap" was not found in the UIManager.

This error is located at: in AIRMap (at MapView.js:760) in MapView (at App.js:25) in RCTView (at View.js:43) in App (at renderApplication.js:32) in RCTView (at View.js:43) in RCTView (at View.js:43) in AppContainer (at renderApplication.js:31)

how to fix this error in react native ios ?

Apple Sign in doesn't work on Testflight?

$
0
0

Apple sign in works in Expo environment, but when i create build and upload it to Testfligh, Apple Sign in button doesn't prompt anything?

React-Native: Changing tabbar showing weird top to bottom flickering

$
0
0

I am developing a Tabbar application, I have a Tabbar, which Tabbar has its own navigation stack. The problem is when I am changing tab from bottom tabbar, my screen showing flickering (top to bottom) in iOS only, It works fine in Android.

I am using default header. Did anyone faced this issue before?


Why can't I query available in-app purchases

$
0
0

I have a React Native Expo project. I'm using this library. - for in app payments on iOS.

The issue is, my query for available in-app purchases is returning nothing.

While the purchases can't be retrieved, I can't build any payments.

Notes:

  • I'm testing RN app through the Expo iOS client
  • In app purchases are ready to submit in Apple connect
  • App has all data complete in Apple connect, but is not submitted yet

Here is the code. It's copypaste from the GitHub documentation

 try {        await InAppPurchases.connectAsync();        const items = Platform.select({          ios: ["basic", "medium", "best"],          android: [],        });        // Retrieve product details        const getPurchasable = await InAppPurchases.getProductsAsync(items);        const { responseCode, results } = getPurchasable;

How to get status of playback (media player) on device and listen for changes using expo react-native app?

$
0
0

I'm trying to get information from the now playing playback of an ios and android device for my expo react-native app and listen for changes. I'm trying to use expo-av but can't seem to accomplish this. Any help is greatly appreciated. I would like to stick with expo if possible.

How to upload Image on server using ReactNative

$
0
0

I am setting headers and body , Using fetch with Post to upload image on server.I am getting the response code 200 but it is not uploading image but rest of the Data is getting uploaded.

Here is the code of body:

export default function setRequestBody(imagePath){    let boundry = "----WebKitFormBoundaryIOASRrUAgzuadr8l";    let body = new FormData();    body.append("--"+boundry+"\r\n");    body.append("Content-Disposition: form-data; name=imageCaption\r\n\r\n");    body.append("Caption"+"\r\n");    body.append("--"+boundry+"\r\n");    body.append("Content-Disposition: form-data; name=imageFormKey; filename =iimageName.pngg \r\n");    body.append("Content-Type: image/png \r\n\r\n");    body.append({uri : imagePath});    // appened image Data Here    body.append("\r\n");    body.append("--"+boundry+"--\r\n");    return body}

Please help.What mistake I am making. :(

Swiper with video or image on the card

$
0
0

I have a list of objects that contain a video or photo

I would like to make scrolling possible (up - down - up, something like in TikTok). Each card has a full-screen image or video.

For this I used the library:

https://www.npmjs.com/package/react-native-swiper

Scrolling works as intended, but there are other problems:

  • all objects load immediately (there should be some pagination)

  • all objects start immediately (when the video has sound then everyone starts playing)

Is there another useful solution or can something be done with this library?

Expo management menu from within the device/emulator without shaking device

$
0
0

I find shaking the phone to access the expo development menu to be inconvenient. It is difficult to get a feel of how I should shake my phone, and I feel awkward trying to peek if the menu appeared already while shaking.

During the application development phase it would be convenient to access the developer menu through a temporary GUI element. Does there exist a package that provides a component that allows accessing the developer menu by tapping or similar means? (I imagine it like a tiny floating button object that can be moved around, a little bit like Facebook messenger thing, but how it operates is really not that important.) If there is no such thing, then is there Expo APIs I could use to implement such a component by myself?

Viewing all 16563 articles
Browse latest View live


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