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

Is there a way where I can check if an apple pencil is connected in an expo project?

$
0
0

I'm building an app, where I need to determine if an apple pencil is connected and if the touch event is from the apple pencil.


Audio background mode not working with react-native-track-player

$
0
0

I'm currently use react-native-track-player to stream audio from Internet. Works fine.

I would like now to use it in background mode, to be able to continue to listen to radio if my ap is in background mode.

I followed instructions from https://react-native-kit.github.io/react-native-track-player/background/, so add capabilities in xCode, with should be enough.

It doesn't work so I also add

TrackPlayer.updateOptions({
    stopWithApp: false
});

but stil not working.

Any idea or experience with this audio library in background mode ? Thanks !

'expo' is not recognized as an internal or external command

$
0
0

After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external command. Does anyone know how I might get around this issue using windows 10, or what to do in terms of something like a path variable.

Exiting because upload-symbols was run in validation mode

$
0
0

Im trying to add Fabric to my xcode project. I've done so succesfully in the past but now facing issues with a react-native project. Having looked around, i've tried pretty much all combinations suggested out there. My setup looks like so:

enter image description here

I've also tried the Pods version using "${PODS_ROOT}/Fabric/run" however no matter what i do im unable to proceed from the Add Run Script step.

In attempt to try and debug i've directed the output of what the Fabric command produces to a file. It yields the following:

Running upload-symbols in Build Phase mode Validating build environment for Crashlytics... Validation succeeded. Exiting because upload-symbols was run in validation mode

Any help much appreciated. Im very unsure as to how to take it from here

ADDITIONAL_INFO:

I've reinstalled the Fabric Mac app from scratch, restarted both xcode,fabric app and the whole system in general. Tried building in release mode and have pretty much tried everything here:

Crashlytics in iOS won't proceed past "Build Your Project" in Fabric app

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-me?

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>
    </>
  );
};

How can i check push notification permission for both ios and android in react native?

$
0
0

I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.

React Native - secureTextEntry Disable IO 13+ Strong Password behavior

$
0
0

I have an create account form in my app and now on iOS devices running 13+ I'm having an issue where if the the user presses the "done" key while entering a password the normal secure password dots are replaced with the following (see below). How to disable this behavior so it continues to work as it did on older devices?

enter image description here

library not found for -lAppAuth

$
0
0

I try build IPA file on Xcode from .xcodeproj file and I obtain next error log:

library not found for -lAppAuth

And I never installed that package.

After that, I've decided to install this package, but error continues

Steps:

  • Generic iOS device
  • Product>Archive

error log

Enviroment

  • React v16.9.0
  • React Native v0.61.2
  • MacOS Movaje 10.14.3
  • Xcode 10.3 (not update because i can't update OS)

React Native - secureTextEntry Disable IOS 13+ Strong Password behavior

$
0
0

I have an create account form in my app and now on iOS devices running 13+ I'm having an issue where if the the user presses the "done" key while entering a password the normal secure password dots are replaced with the following (see below). How to disable this behavior so it continues to work as it did on older devices?

enter image description here

Customise tabs of native base

$
0
0

I need to customise tabs (change their background color ) from native base in my react native application, like shown in the image enter image description here

I've already tried this style={{ backgroundColor: '#C0C0C0' }} but i keep getting the default theme.

How to detect Ibeacons panic button in react-native?

$
0
0

I am using import Beacons from "react-native-beacons-manager"; for getting the data from Beacons to a device either ios/android.

Now my concern is is there any method which will handle is panic button pressed or not?

Value for title can not be cast from ReadablenativeMap to string

$
0
0
InsertDataToServer = () => {
const { pinValue1 } = this.state;
const { pinValue2 } = this.state;
const { pinValue3 } = this.state;
const { pinValue4 } = this.state;
var String_3 = pinValue1.concat("" , pinValue2);
var String_4 = String_3.concat("" ,  pinValue3);
var String_5 = String_4.concat("" ,  pinValue4);

fetch("http://www.aonde.biz/mobile/doLogin.php", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "pin":212,

  })
})
  .then(response => response.json())
  .then(responseJson => {
    // Showing response message coming from server after inserting records.
    Alert.alert(responseJson);
  })
  .catch(error => {
    console.error(error);
  });

In the above code when I pass pin parameter API then show this error. Thank youin image show full erro please give some idea how to resolve this issue.

How do I make an iOS UIPicker in react native with multiple columns and titles?

$
0
0

Let's pretend my problem is I want a user to be able to select an amount of apples, and an amount of pears, with one control. I see the picker in the "Timer" section of the clock app bundled with iOS, and I like it.

iOS Timer picker

I want exactly that, except instead of three columns, I want two, and instead of "hours" and "min", I want "apples" and "pears".

So far, I'm able to put two pickers next to each other, which, while not curving the items towards each other slightly as if they were on the same wheel, is good enough for me for my columns problem for now. I'm as yet unable to put titles on the rows, though.

Here's what I have:

  render() {
    let PickerIOSItem = PickerIOS.Item
    return (
      <View style={styles.container}>
        <PickerIOS style={styles.column}>
          <PickerIOSItem value={1} label="0" />
          <PickerIOSItem value={2} label="1" />
          <PickerIOSItem value={3} label="2" />
          <PickerIOSItem value={4} label="3" />
          <PickerIOSItem value={5} label="4" />
        </PickerIOS>
        <PickerIOS style={styles.column}>
          <PickerIOSItem value={1} label="0" />
          <PickerIOSItem value={2} label="1" />
          <PickerIOSItem value={3} label="2" />
          <PickerIOSItem value={4} label="3" />
          <PickerIOSItem value={5} label="4" />
        </PickerIOS>
      </View>
    );
  }

styles.container has display: flex and flex-direction: row, and styles.column has width: 49%.

My garbage attempt

React native get music files

$
0
0
 { [TypeError: null is not an object (evaluating 'RNReactNativeGetMusicFiles.getAll')]
line: 96542,
column: 37,

This error comes up when I try to get all music in ios.

I have executed both pod install and react native link.

Does anyone know what can be done or any other alternative for getting device music in ios in react native?

UMModuleRegistryAdapter.h not found when running React Native app in iOS simulator

$
0
0

I have a simple React Native app that I've been testing on Android and now want to test on iOS. It's using React Navigation.

I ran npm run ios but I'm getting the following error:

info In file included from 

/Users/rbbit/reactnative/testproj1/ios/testproj1/main.m:10:

/Users/rbbit/reactnative/testproj1/ios/testproj1/AppDelegate.h:9:9: fatal error: 'UMReactNativeAdapter/UMModuleRegistryAdapter.h' file not found

#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

info 1 error generated.

I opened XCode but I'm basically getting the same message, nothing else that would help me debug this.

I do see that there is a package called react-native-adapter (https://github.com/expo/expo/tree/master/packages/%40unimodules/react-native-adapter), however I'm hesitant to just install this since I followed the instructions on how to include react-navigation and didn't mention that, assuming this is related.

Also, that page says If you are using react-native-unimodules, this package will already be installed and configured!, and react-native-unimodules already is in my dependencies.

Any pointers on how to solve this? Thank you!


xcode 'boost/config/user.hpp' file not found

$
0
0

I'm using Xcode 9, everything was fine. but after I upgrade my React-native version to 0.46, and upgrade my React to 16.0.0 alpha12. and re-run my project, Xcode gives me an error 'boost/config/user.hpp' file not found, I use brew install boost to install boost. but it doest work. It seems like something wrong with react-native, because I can use Xcode to create a new iOS project and works fine, but when I use 'react-native init newProject', It gives me the same error.

Camera Module in "React Native" to display recently clicked image

Conditions for a native module to not be exposed to Javascript

$
0
0

I have a native iOS module that is suddenly not exposed anymore to Javascript. I'm using RN 0.59.4.

It seems that it happened after I renamed the iOS project.

What I can say is that I'm using dependency injection, not RCT_EXPORT_MODULE.

The module initialisation code is called, I've verified it by setting breakpoints in key areas such as requiresMainQueueSetup.

I guess my question is this: under which known conditions a module may not be exposed to JavaScript?

Any help appreciated.


EDIT 1: I've pinpointed the problem to RCTCxxUtils::createNativeModules() which at first receives 105 elements with my module, but is called a second time with only 104 elements.


EDIT 2: For what its worth, here are the back traces of each calls:

First Call => modules=105 elements in frame #0

* thread #9, name = 'com.facebook.react.JavaScript', stop reason = breakpoint 3.1
  * frame #0: 0x0000000100c4e6d4 CardioSensys`facebook::react::createNativeModules(modules=105 elements, bridge=0x0000000102d14490, instance=std::__1::shared_ptr<facebook::react::Instance>::element_type @ 0x000000028100d7c0 strong=1 weak=1) at RCTCxxUtils.mm:39:3
    frame #1: 0x0000000100bcd840 CardioSensys`::-[RCTCxxBridge _buildModuleRegistryUnlocked](self=0x0000000102d14490, _cmd="_buildModuleRegistryUnlocked") at RCTCxxBridge.mm:520:10
    frame #2: 0x0000000100bceb84 CardioSensys`::-[RCTCxxBridge _initializeBridgeLocked:](self=0x0000000102d14490, _cmd="_initializeBridgeLocked:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283ae7058 strong=3 weak=1) at RCTCxxBridge.mm:573:36
    frame #3: 0x0000000100bce39c CardioSensys`::-[RCTCxxBridge _initializeBridge:](self=0x0000000102d14490, _cmd="_initializeBridge:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283ae7058 strong=3 weak=1) at RCTCxxBridge.mm:550:5
    frame #4: 0x0000000100bcb498 CardioSensys`::__21-[RCTCxxBridge start]_block_invoke.168(.block_descriptor=0x0000000283ae6dc0) at RCTCxxBridge.mm:344:5
    frame #5: 0x0000000100bdefa0 CardioSensys`decltype(__f=0x000000016fa15c58) block_pointer __strong&>(fp)()) std::__1::__invoke<void () block_pointer __strong&>(&&, decltype(std::__1::forward<void () block_pointer __strong&>(fp)())&&...) at type_traits:4361:1
    frame #6: 0x0000000100bdef3c CardioSensys`void std::__1::__invoke_void_return_wrapper<void>::__call<void (__args=0x000000016fa15c58) block_pointer __strong&>(void () block_pointer __strong&) at __functional_base:349:9
    frame #7: 0x0000000100bdef14 CardioSensys`std::__1::__function::__alloc_func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016fa15c60)() at functional:1527:16
    frame #8: 0x0000000100bdd6b8 CardioSensys`std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016fa15c58)() at functional:1651:12
    frame #9: 0x00000001008722c0 CardioSensys`std::__1::__function::__value_func<void ()>::operator(this=0x000000016fa15c58)() const at functional:1799:16
    frame #10: 0x00000001008709dc CardioSensys`std::__1::function<void ()>::operator(this=0x000000016fa15c58)() const at functional:2347:12
    frame #11: 0x0000000100c4ed98 CardioSensys`facebook::react::tryAndReturnError(func=0x000000016fa15c58)> const&) at RCTCxxUtils.mm:72:7
    frame #12: 0x0000000100bc9e44 CardioSensys`::-[RCTCxxBridge _tryAndHandleError:](self=0x0000000102d14490, _cmd="_tryAndHandleError:", block=0x0000000100bcb434) at RCTCxxBridge.mm:257:20
    frame #13: 0x000000018d465690 Foundation`__NSThreadPerformPerform + 336
    frame #14: 0x000000018c96ff2c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #15: 0x000000018c96feac CoreFoundation`__CFRunLoopDoSource0 + 88
    frame #16: 0x000000018c96f794 CoreFoundation`__CFRunLoopDoSources0 + 176
    frame #17: 0x000000018c96a6d0 CoreFoundation`__CFRunLoopRun + 1004
    frame #18: 0x000000018c969fc4 CoreFoundation`CFRunLoopRunSpecific + 436
    frame #19: 0x0000000100bc9c8c CardioSensys`::+[RCTCxxBridge runRunLoop](self=RCTCxxBridge, _cmd="runRunLoop") at RCTCxxBridge.mm:249:36
    frame #20: 0x000000018d4654a0 Foundation`__NSThread__start__ + 984
    frame #21: 0x000000018c5f92c0 libsystem_pthread.dylib`_pthread_body + 128
    frame #22: 0x000000018c5f9220 libsystem_pthread.dylib`_pthread_start + 44
    frame #23: 0x000000018c5fccdc libsystem_pthread.dylib`thread_start + 4

Second call => modules = 104 elements in frame #0

* thread #19, name = 'com.facebook.react.JavaScript', stop reason = breakpoint 3.1
  * frame #0: 0x0000000100c4e6d4 CardioSensys`facebook::react::createNativeModules(modules=104 elements, bridge=0x0000000102d1b8c0, instance=std::__1::shared_ptr<facebook::react::Instance>::element_type @ 0x000000028100e4e0 strong=1 weak=1) at RCTCxxUtils.mm:39:3
    frame #1: 0x0000000100bcd840 CardioSensys`::-[RCTCxxBridge _buildModuleRegistryUnlocked](self=0x0000000102d1b8c0, _cmd="_buildModuleRegistryUnlocked") at RCTCxxBridge.mm:520:10
    frame #2: 0x0000000100bceb84 CardioSensys`::-[RCTCxxBridge _initializeBridgeLocked:](self=0x0000000102d1b8c0, _cmd="_initializeBridgeLocked:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283909318 strong=3 weak=1) at RCTCxxBridge.mm:573:36
    frame #3: 0x0000000100bce39c CardioSensys`::-[RCTCxxBridge _initializeBridge:](self=0x0000000102d1b8c0, _cmd="_initializeBridge:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283909318 strong=3 weak=1) at RCTCxxBridge.mm:550:5
    frame #4: 0x0000000100bcb498 CardioSensys`::__21-[RCTCxxBridge start]_block_invoke.168(.block_descriptor=0x00000002834686c0) at RCTCxxBridge.mm:344:5
    frame #5: 0x0000000100bdefa0 CardioSensys`decltype(__f=0x000000016ff3dc58) block_pointer __strong&>(fp)()) std::__1::__invoke<void () block_pointer __strong&>(&&, decltype(std::__1::forward<void () block_pointer __strong&>(fp)())&&...) at type_traits:4361:1
    frame #6: 0x0000000100bdef3c CardioSensys`void std::__1::__invoke_void_return_wrapper<void>::__call<void (__args=0x000000016ff3dc58) block_pointer __strong&>(void () block_pointer __strong&) at __functional_base:349:9
    frame #7: 0x0000000100bdef14 CardioSensys`std::__1::__function::__alloc_func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016ff3dc60)() at functional:1527:16
    frame #8: 0x0000000100bdd6b8 CardioSensys`std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016ff3dc58)() at functional:1651:12
    frame #9: 0x00000001008722c0 CardioSensys`std::__1::__function::__value_func<void ()>::operator(this=0x000000016ff3dc58)() const at functional:1799:16
    frame #10: 0x00000001008709dc CardioSensys`std::__1::function<void ()>::operator(this=0x000000016ff3dc58)() const at functional:2347:12
    frame #11: 0x0000000100c4ed98 CardioSensys`facebook::react::tryAndReturnError(func=0x000000016ff3dc58)> const&) at RCTCxxUtils.mm:72:7
    frame #12: 0x0000000100bc9e44 CardioSensys`::-[RCTCxxBridge _tryAndHandleError:](self=0x0000000102d1b8c0, _cmd="_tryAndHandleError:", block=0x0000000100bcb434) at RCTCxxBridge.mm:257:20
    frame #13: 0x000000018d465690 Foundation`__NSThreadPerformPerform + 336
    frame #14: 0x000000018c96ff2c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #15: 0x000000018c96feac CoreFoundation`__CFRunLoopDoSource0 + 88
    frame #16: 0x000000018c96f794 CoreFoundation`__CFRunLoopDoSources0 + 176
    frame #17: 0x000000018c96a6d0 CoreFoundation`__CFRunLoopRun + 1004
    frame #18: 0x000000018c969fc4 CoreFoundation`CFRunLoopRunSpecific + 436
    frame #19: 0x0000000100bc9c8c CardioSensys`::+[RCTCxxBridge runRunLoop](self=RCTCxxBridge, _cmd="runRunLoop") at RCTCxxBridge.mm:249:36
    frame #20: 0x000000018d4654a0 Foundation`__NSThread__start__ + 984
    frame #21: 0x000000018c5f92c0 libsystem_pthread.dylib`_pthread_body + 128
    frame #22: 0x000000018c5f9220 libsystem_pthread.dylib`_pthread_start + 44
    frame #23: 0x000000018c5fccdc libsystem_pthread.dylib`thread_start + 4

EDIT 3: The first time, I have a call to registerExtraModules and this is where my module is added. The second time, a if condition is not satisfied, thus the extra module not added.

  if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) 

    {
        extraModules = [self.delegate extraModulesForBridge:_parentBridge];
      } else if (self.moduleProvider) {
        extraModules = self.moduleProvider();
      }

EDIT 4: I had to went back to the project before renaming and do it again to solve my problem. Today the problem is back again, this time as soon as I added a new native module.

Could not find iPhone X simulator. Run CLI with --verbose flag for more details

$
0
0

I downloaded the recently released Xcode 11 beta version, and now I can't run my React-Native app on my simulator. I know there are some question on stack-overflow about this but they did'nt help. the problem is there is no

/node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

file at all. in the local-cli folder there is only one file named cli.js

'use strict';

var cli = require('@react-native-community/cli');

if (require.main === module) {
  cli.run();
}

module.exports = cli;

How to correctly trim user input in React Native?

$
0
0

I have TextInput that receives onChangeText as a prop:

<TextInput
  ...
  value={this.state.myString}
  onChangeText={this.updateInput.bind(this)}
/>

And updateInput is represented as:

updateInput(newString) {
  this.setState({ myString: newString.trim() });
}

This works for Android only. Is there some way to trim user input on both platforms (iOS, Android)?

Update

Actually, string is processed as trimmed, but you can still type as many whitespaces as you want on iOS. And if you type two whitespaces in a row the dot appears like it would be the end of the sentence. This is undesirable behaviour, is there a way to avoid it?

Link with example video: https://streamable.com/dzl3c

Viewing all 16566 articles
Browse latest View live


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