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

React Native : BLE, Discover & Broadcast (advertise data)

$
0
0

I'm very new to BLE APIs and capabilities. I want to achieve a "simple" thing. Let's say I'm developing the APP-X. I want to be able to scan other phone around me, with APP-X installed (exactly like this app here https://www.tracetogether.gov.sg/ ). I want to scan and filter the wanted devices via a "simple" metadata (advertising data ? specific for my app) within the signal emitted by the concerned phones. I'm stuck because Idk how to "emit" (broadcast) that custom signal.

Can you please help me find a way to do this in RN ?

I have already check those libs:

Many thanks


Forcing onLayout on React Native view

$
0
0

I have a React Native View containing a Text field, and I'm using the onLayout prop to do some positional calculations which rely on the data it provides.

<View onLayout={this.calculateDimensions}><Text>{this.props.content}</Text></View>

This works well, but there is a scenario where the content prop updates to a different string with the same character size. This results in the layout not changing and onLayout not triggering.

These positional calculations must occur each time the content prop updates.

Note: I am aware there are numerous ways to make the component update. Updating is not the same as laying out and sadly does not trigger onLayout.

Background notification not working ( iOS / react-native-firebase v7)

$
0
0

I`m using react-native-firebase v7 and not getting background notifications. Its happened only ios devices also in the background. It's working in the foreground without any issue.

Using

"@react-native-firebase/messaging": "^7.1.0""react": "16.9.0","react-native": "^0.61.5",

React Native init specific version

$
0
0

I upgraded my latest project to React Native 0.19 and instantly the video no longer works. How can I create a new project with a specific version? I want to init a new project at version 0.18.1. I did some google searches but couldn't find anything about this.

$ react-native init newproject --verbose

I'm guessing I need to add the word @18.1 in there somewhere but can't get that to work.

How do you hide the warnings in React Native iOS simulator?

$
0
0

I just upgraded my React Native and now the iOS simulator has a bunch of warnings. Besides fixing them, how do I hide these warnings so that I can see what's underneath?

How to install expo .ipa on iPhone 6?

$
0
0

I have build an ipa with expo build:ios --apple-id ${EXPO_APPLE_ID} -t simulator --release-channel staging --non-interactive.

I have downloaded the ipa using curl -o ${CI_BUILD_TAG}-staging.ipa "$(npx expo url:ipa --non-interactive)" and I want to install it with XCode on an iPhone 6.

Within xcode, I go on Window > Devices and Simulator, on the left panel I see my iPhone, where I can drag and drop .ipa into Installed Apps list.

I expect the ipa to install, instead I have the following error:

image

I have never published on the app store and this is my first native app.

Is it Xcode or the ipa, is there a way to solve this?

Does that mean my app is broken and won't work on iOS because locally it works and I do not want to be fooled?

Xcode can not build React Native Project, Undefined symbols for architecture x86_64

$
0
0

My project is not able to build with Xcode after my Xcode Command Line Tools & MacOS upgraded.

Running npx react-native run-ios works fine, can wake up the simulator and debug.

When build on Xcode, I receive this error:

Undefined symbols for architecture x86_64:"___isOSVersionAtLeast", referenced from:      -[GDTCORApplication init] in libGoogleDataTransport.a(GDTCORPlatform.o)      ___28-[GDTCORStorage storeEvent:]_block_invoke.22 in libGoogleDataTransport.a(GDTCORStorage.o)      -[GDTCORStorage appWillForeground:] in libGoogleDataTransport.a(GDTCORStorage.o)      ___35-[GDTCORStorage appWillBackground:]_block_invoke in libGoogleDataTransport.a(GDTCORStorage.o)      -[GDTCORStorage appWillTerminate:] in libGoogleDataTransport.a(GDTCORStorage.o)+[GULSecureCoding unarchivedObjectOfClasses:fromData:error:] in libGoogleUtilities.a(GULSecureCoding.o)+[GULSecureCoding archivedDataWithRootObject:error:] in libGoogleUtilities.a(GULSecureCoding.o)      ...ld: symbol(s) not found for architecture x86_64clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Why is mapPadding Prop not giving any padding on iOS devices when padding is specified?

$
0
0

I'm having an issue in which upon rendering a map using react-native-maps we are not able to display map padding on iOS devices only.

It's interesting because, Android devices do display the map padding properly, but iOS devices won't show any padding at all when that prop is set.

Here is the following code that works on Android devices but NOT iOS devices in regards to mapPadding:

<MapView          ref={(map) => (this.map = map)}          mapPadding={{ top: 0, right: 0, bottom: 550, left: 0 }}          paddingAdjustmentBehavior="always"          initialRegion={{            latitude: 30.2303 - 0.0123,            longitude: -97.7538,            latitudeDelta: 0.2,            longitudeDelta: 0.1,          }}          style={styles.mapStyle}>          {crawlCard.map((crawl, index) => {            return (<Marker                coordinate={{                  latitude: crawl.coords.lat,                  longitude: crawl.coords.lon,                }}                title={crawl.title}                key={index}                onSelect={() => {                  this.map.animateToRegion(                    {                      latitude: crawl.coords.lat,                      longitude: crawl.coords.lon,                    },                    200                  );                }}              />            );          })}</MapView>

Is there any other function/method we need to implement to get this mapPadding prop to work on iOS devices? All examples my team & I have seen have used the mapPadding just like this for both platforms.

We're using:React Native 5.xreact-native-maps 0.26.1

Any assistance would be greatly appreciated. Thank you kindly!


IOS: Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d

$
0
0

I am facing an issue while I am returning after some time in the App, can anyone help me in this regard?

Please find the below crash log.

I did some research regarding this issue & I found some questions in StackOverflow and GitHub, but as I am pretty new in React Native/App development I am unable to figure out the way and steps to resolve the issue.

Crash log

Date/Time:           2020-06-03 21:50:48.8370 +0400Launch Time:         2020-06-03 21:50:22.7923 +0400OS Version:          iPhone OS 13.4.1 (17E262)Release Type:        UserBaseband Version:    7.51.01Report Version:      104Exception Type:  EXC_CRASH (SIGKILL)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note:  EXC_CORPSE_NOTIFYTermination Reason: Namespace SPRINGBOARD, Code 0x8badf00dTermination Description: SPRINGBOARD, process-exit watchdog transgression: application<com.bankonus>:5046 exhausted real (wall clock) time allowance of 5.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: process-exit | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 1.840 (user 1.840, system 0.000), 18% CPU", | "Elapsed application CPU time (seconds): 0.002, 0% CPU" | )Triggered by Thread:  0Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_kernel.dylib          0x0000000192f7e77c 0x192f58000 + 1575641   libdispatch.dylib               0x0000000192df50a8 0x192df3000 + 83602   libdispatch.dylib               0x0000000192df4fe8 0x192df3000 + 81683   bankonus                        0x0000000104331b2c 0x1041b0000 + 15798204   bankonus                        0x0000000104373990 0x1041b0000 + 18497445   bankonus                        0x00000001043738f0 0x1041b0000 + 18495846   bankonus                        0x0000000104371d80 0x1041b0000 + 1842560

IOS app crashes: Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d

$
0
0

I am facing an issue while I am returning after some time in the App, can anyone help me in this regard?

Please find the below crash log.

I did some research regarding this issue & I found some questions in StackOverflow and GitHub, but as I am pretty new in React Native/App development I am unable to figure out the way and steps to resolve the issue.

Crash log

Date/Time:           2020-06-03 21:50:48.8370 +0400Launch Time:         2020-06-03 21:50:22.7923 +0400OS Version:          iPhone OS 13.4.1 (17E262)Release Type:        UserBaseband Version:    7.51.01Report Version:      104Exception Type:  EXC_CRASH (SIGKILL)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note:  EXC_CORPSE_NOTIFYTermination Reason: Namespace SPRINGBOARD, Code 0x8badf00dTermination Description: SPRINGBOARD, process-exit watchdog transgression: application<com.bankonus>:5046 exhausted real (wall clock) time allowance of 5.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: process-exit | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 1.840 (user 1.840, system 0.000), 18% CPU", | "Elapsed application CPU time (seconds): 0.002, 0% CPU" | )Triggered by Thread:  0Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_kernel.dylib          0x0000000192f7e77c 0x192f58000 + 1575641   libdispatch.dylib               0x0000000192df50a8 0x192df3000 + 83602   libdispatch.dylib               0x0000000192df4fe8 0x192df3000 + 81683   bankonus                        0x0000000104331b2c 0x1041b0000 + 15798204   bankonus                        0x0000000104373990 0x1041b0000 + 18497445   bankonus                        0x00000001043738f0 0x1041b0000 + 18495846   bankonus                        0x0000000104371d80 0x1041b0000 + 1842560

React-Native Firebase ML Kit Vision Image Labeling not working with iOS

$
0
0

I am trying to use RNFirebase MLKit image labelling in my RN app. It works fine on android, but on iOS i get the following error,

NativeFirebaseError: [vision/file-not-found] The local file specified does not exist on the device.

The images are taken though "@react-native-community/cameraroll" and the ios image path is as follows,

ph://45983F53-3C96-42D0-9337-C9F681293627/L0/001

The fixes i have tried are,

import {utils} from '@react-native-firebase/app';${utils.FilePath.PICTURES_DIRECTORY}/${                d[key].node.image.filename             }
'assets-library'+'://asset/asset.JPEG?id='+               d[key].node.image.uri.substring(5).replace('/L0/001', '') +'&ext=JPEG'
ph-upload://45983F53-3C96-42D0-9337-C9F681293627/L0/001

None of the above worked.

The Build versions are,

"react-native": "0.62.2"."@react-native-community/cameraroll": "^1.5.2"."@react-native-firebase/ml-vision": "^7.1.0","@react-native-firebase/app": "^7.1.0",

Cannot update pod due to dependencies in React Native module

$
0
0

I am trying to update SnowplowTracker of our app. I changed the version of SnowplowTracker on my PodFile:

pod 'SnowplowTracker', '~> 1.3'

However I am getting this error when I run my pod install:

[!] CocoaPods could not find compatible versions for pod "SnowplowTracker":  In Podfile:    RNVideo (from `../node_modules/react-native-video`) was resolved to 3.9.2, which depends on      MCTracker (~> 1.1.0) was resolved to 1.1.0, which depends on        SnowplowTracker (= 1.1.4)    SnowplowTracker (~> 1.3)Specs satisfying the `SnowplowTracker (~> 1.3), SnowplowTracker (= 1.1.4)` dependency were found, but they required a higher minimum deployment target.

How can I solve this problem?

Thank you

React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template

$
0
0

While executing npx react-native init MyProject I ran into the following error:

✖ Installing CocoaPods dependencies (this may take a few minutes)error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.

Which seems to be related to an earlier error displayed:

checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot checking whether the C compiler works... noxcrun: error: SDK "iphoneos" cannot be locatedxcrun: error: SDK "iphoneos" cannot be locatedxcrun: error: SDK "iphoneos" cannot be locatedxcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

XCode and its CLI seem to all run fine.

My configuration:

  • MacOS Catalina 10.15.1 (19B88)
  • NPM 6.11.3
  • React-Native 0.61.4
  • XCode 11.2.1 (11B500)

Any leads appreciated.

How to set ReactNative app as default system app?

$
0
0

Actually, I am working on a ReactNative app like TrueCaller.

The problem is how to show the received call in my app instead of the default system UI?

Regards

UMReactNativeAdapter not found in an ios build

$
0
0

trying to run an ios build for a project writen in react-native and ran into some issued. was trying to fix this "UMReactNativeAdapter not found" problem, read some solutions here but nothing worked, any suggestions?

i am using react-native-cli: 2.0.1, and in my podFile i added:

require_relative '../node_modules/react-native-unimodules/cocoapods'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'require_relative '../node_modules/react-native-unimodules/cocoapods.rb'

thanks.


Failed to load bundle with aws-sdk for react-native

$
0
0

After installing aws-sdk for react native and adding:

var AWS = require('aws-sdk/dist/aws-sdk-react-native');

to one of the screens, my app bundle loads up to 99%, freezes and then I get the following error:

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Could not connect to development server.Ensure the following:- Node server is running and available on the same network - run 'npm start' from react-native root- Node server URL is correctly set in AppDelegate- WiFi is enabled and connected to the same network as the Node Server

...

also this error message appears in my Xcode terminal:

Call retries were exceeded aws react native

How to fix this bug?

from my package.json:

"dependencies": {        ..."amazon-kinesis-video-streams-webrtc": "^1.0.8","aws-sdk": "^2.689.0","events": "^3.1.0","react": "16.11.0","react-native": "0.62.2",         ...      },

React Native Firebase build error

$
0
0

I've been struggling with getting my react native instance to run and i keep hitting this:

** BUILD FAILED **The following build commands failed:    CompileC /Users/alexvallejo/Sites/myProj/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/BannerComponent.o /Users/alexvallejo/Sites/myProj/node_modules/react-native-firebase/ios/RNFirebase/admob/BannerComponent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler    CompileC /Users/alexvallejo/Sites/myProj/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/NativeExpressComponent.o /Users/alexvallejo/Sites/myProj/node_modules/react-native-firebase/ios/RNFirebase/admob/NativeExpressComponent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler(2 failures)Installing build/Build/Products/Debug-iphonesimulator/myProj.appAn error was encountered processing the command (domain=MIInstallerErrorDomain, code=4):Failed to chmod /Users/alexvallejo/Library/Developer/CoreSimulator/Devices/31C5C7FC-9DE4-4F95-A7F5-50296C8CC6CB/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/0170A665-460A-4CDF-92B4-0FAC8FBE2224/myProj.app/myProj : No such file or directoryLaunching org.reactjs.native.example.myProj

Any ideas on what's going on here? I dont have pod 'Firebase/AdMob' in my Podfile so i don't know why BannerComponent is trying to load.

How to use a geolocation component that watches changes in geolocation?

$
0
0

I have a App component which is:

import Home from './screens/Home';import * as React from 'react';const App = () => {  return <Home />;};export default App;

My home component looks like:

  export default class Home extends React.PureComponent {  render() {    return (<><View style={styles.container}><Text style={styles.heading}> Location Manager </Text><CurrentLocation /><LocationList /></View><ClearButton /></>    );  }}

I wrote a component that watches for location changes:it looks like:

export const useGeolocation = (): [string, GeolocationData] => {  const [error, setError] = useState('');  const [position, setPosition] = useState<GeolocationData>({    latitude: 0,    longitude: 0,  });  useEffect(() => {    const watchId = Geolocation.watchPosition(      (pos) => {        setError('');        setPosition({          latitude: pos.coords.latitude,          longitude: pos.coords.longitude,        });      },      (e) => setError(e.message),    );    return () => Geolocation.clearWatch(watchId);  }, []);  return [error, position];};

Now how do I use this component? where do I place this? I read it on a tutorial that it will unsubscribe when user is not using the app (backgrounded) or component will unmount? How to achieve that?

Can I use experimental WebKit features in my iOS app?

$
0
0

I am developing an iOS app with react-native. I wanted to use MediaRecorder which is still in 'experimental' phase. I turned it on in advanced Safari settings but when I try to use it in my app:

var mediaRecorder = new MediaRecorder(stream)

I get this error:

ReferenceError: Can't find variable: MediaRecorder

This feature works well in safari, but I can't get it to work in my app. Is there a way to turn it on in Xcode/real-native settings?

how to add third party (.)framework as dependency for React native native module in Xcode

$
0
0

We have a SDK which depends on Alamofire and Private framework to function. Now we are trying to build a wrapper over the SDK for react native. We created native module code and added Alamofire as dependency for it through Podspec. Our private framework is not hosted anywhere. Now we want to add this private framework to react native native module as dependency. We tried adding to react native project/iOS part, but react native project complaints while building the native module about pvt_framework_headers.h not found. Private framework is added and embedded correctly. How to add external dependencies to react native module?

Podspec file:

  s.dependency "React"  # ...  # s.dependency "..."  s.dependency 'IQKeyboardManagerSwift'  s.dependency 'SwiftyJSON'  s.dependency 'SVProgressHUD'  s.dependency 'Alamofire'  s.dependency 'AFNetworking', '~> 3.0'

Any help or guidance highly appreciated.

Viewing all 16564 articles
Browse latest View live


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