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

How to change manually project.pbxproj file in Xcode during React-native upgrade?

$
0
0

I need to upgrade my React-native app from 0.61.0 to 0.62.0. The best safety way to do it manually with React Native Upgrade Helper https://react-native-community.github.io/upgrade-helper. But during this way a lot of changes need to do in ios/MyProject.xcodeproj/project.pbxproj file in Xcode. But I'm not so familiar with it. Can somebody recommend me please how to make changes in project.pbxproj in Xcode for upgrade of RN version?


Redirection to the page or screen on tap of notification tap in React with Cordova

$
0
0

How to redirect to the particular screen onTap of notification in React with Cordova. This is my code to trigger notifications I have implemented the notification with firebase cloud message using the below library.

https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated.

This is my code for getting token and payload.

 FCM.requestPushPermission({    ios9Support: {        timeout: 10,         interval: 0.3,    },}).then((wasPermissionGiven) => {    console.log(wasPermissionGiven);    if (wasPermissionGiven) {        FCM.getAPNSToken().then((apnsToken) => {            console.log(apnsToken);        });        FCM.getToken().then((apnsToken) => {            console.log(apnsToken);        });        const payloadvar = FCM.onNotification((payload) => {            alert('initialpayload', payload.toString());            console.log('Initialpayload', payload);        });    }});

Can someone help me to implement redirecting a particular page/screen on the notification Tap.

Converting image (iOS) URI from react-native-image-picker to path using rn-fetch-blob

$
0
0

I'm using react-native-image-picker to pick the images. After picking image, I want to upload these image to server using fetch, there I need an absolute file path. So, for converting URI to path I'm using rn-fetch-blob, but it is throwing errors as follow.

failed to stat path "file:///Users/banuharshavardhan/Library/Developer/CoreSimulator/Devices/407B8294-598D-41B3-84FC-E9217F8A434F/data/Containers/Data/Application/63B690A7-976E-4057-91CD-1314B3D3DDBC/tmp/521AC266-01E2-4B20-A8F6-4A3001B0D459.png" because it does not exist or it is not a folder

Can you explain that what I did wrong. I'm running this on iOS simulator.

I'm thinking that, the URI given by react-native-image-picker was a temporary location, that's why it doesn't exists. But don't know what exactly the problem is.

ios App Icon is missing in the simulator using react native

$
0
0

I have added all the icons to their respective places.I added this script that I found in another post but no luck.

enter image description here

I added the script that I found in another post but no luck. I cleaned the build folder hundred times but nothing is working.

React native app crashes when some components module are being imported

$
0
0

My index.ts file looks like as following:

import StaffMembers from './StaffMembers';import GuestMembers from './GuestMembers';export {  StaffMembers,  GuestMembers,};

My folder structure looks likeenter image description here

I'm importing components as

import { StaffMembers, GuestMembers } from '../request/components';

However when my app screen needs to load the component, it crashes giving the below error: Error when app crashes while loading component

When I edit the component's file and save it again, the app works fine.

Is there anything that I'm missing while importing the component? or something else?

React-Native IoS Background Location

$
0
0

Has anyone actually found a way to get background location on react-native-ios that Apple will actually allow on the public store?

I've tried react-native-background-geolocation which works brilliantly does exactly what I want, but Apple simple won't let you deploy to their public store with the required permissions. So can't publish the app and have to go back to the drawing board to find a different solution.

I've tried react-native-begin-background-task with BLE which doesn't work, and playing audio is apparently a hard no.

There must be some way to do this? How do apps like Strava get this right?

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 update Facebook SDK for iOS on Expo 39?

$
0
0

I see the following message in the Events Manager in Facebook Business:

Your app is out of date. To run your app on iOS 14, update to the latest Facebook SDK for IOS.

My Expo version was 38.0 so I updated it to 39.0 but couldn't continue to 40.0 or 41.0 because there were too many errors caused by backward incompatible changes. For this reason I also updated expo-facebook to version 11.1.1.

However, I'm still seeing this warning in the Events Manager.

How can I fix this? Isn't updating expo-facebook to the latest version enough or is updating Expo to version 41.0 my only solution?


How do I stop AirPlay media pausing when app enters background

$
0
0

I have an iOS app built in React Native that plays video content using the react-native-video package and allows the use of AirPlay. When the app enters the background (pressing the home button, locking the screen or opening the swipe down menu) the video is paused and you have to resume play from the control center or lock screen media controls. I understand this is the expected behaviour of AVPlayer and I am trying to implement the following solution from the Apple documentation:

Remove/Restore the AVPlayerLayer and its associated AVPlayer

The code snippets provided are in Swift and I cannot seem to find a complete example of achieving this in my AppDelegate.m file using Objective-C.

I found the following snippet but I am unsure about the steps for getting my player view.

/* Remove the AVPlayerLayer from its associated AVPlayer    once the app is in the background. */- (void)applicationDidEnterBackground:(UIApplication *)application {  MyPlayerLayerView *playerView = <#Get your player view#>;  [[playerView playerLayer] setPlayer:nil]; // remove the player}/* Restore the AVPlayer when the app is active again. */- (void)applicationDidBecomeActive:(UIApplication *)application {  MyPlayerLayerView *playerView = <#Get your player view#>;  [[playerView playerLayer] setPlayer:_player]; // restore the player}

is there any Method available in Heremap for pause and resume navigation in iOS?

$
0
0

I am new to iOS Bridge for React native programming, I am trying for the last 2 days but I don't succeed in that. I am using as per below

[self.navigationManager setPaused: true] // for navigation pause of heremap sdk [self.navigationManager setPaused: false] // for navigation resume of heremap sdk 

but unfortunately, it's not working and navigation still starts after navigation pause. can you. help me to how I pause navigation?

"TypeError: undefined is not an object (evaluating '_react.PropTypes.array')" React native on Mac

$
0
0

I have facing an issue in react native. My React native project completely working on windows environment. And then I have cloned this same project in the Mac system and try to run this project and it is throwing an error."TypeError: undefined is not an object (evaluating '_react.PropTypes.array')". My project has not shown any result for PropTypes. I have restart server so many times. I tried different solutions but nothing work. Please help me to solve this issue

Here is my node logs

 ERROR  TypeError: undefined is not an object (evaluating '_react.PropTypes.array') ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.   This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.    This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

React Native MapView not showing on iOS standalone build

$
0
0

I am using MapView from react-native-maps. I've gone ahead and built standalone apps for both iOS and Android.

I've followed Expo's documentation regarding MapView with standalone apps.

After building the project, the standalone Android version works perfectly fine but iOS only slightly works. As you can see in the picture the Marker shows but not the underlying map. Any ideas why?

iOS Image:

enter image description here

MapView Code:

<MapView  style={styles.map}  customMapStyle={mapStyle}  provider={PROVIDER_GOOGLE}  initialRegion={region}  showsMyLocationButton={false}  followsUserLocation={true}  showsUserLocation  radius={Dimensions.get("window").width * 0.08}  minZoomLevel={3}  maxZoomLevel={20}  rotateEnabled={false}  pitchEnabled={false}  onPress={() => Keyboard.dismiss()}>  {locations &&    locations      .filter((location) => location.data.status === "live")      .map((location, index) => {        return (<Marker            coordinate={{              latitude: location.data.lat,              longitude: location.data.long,            }}            onPress={() =>              navigation.navigate("LocationScreen", { location })            }            key={index}><View style={styles.markerContainer}><Text                style={styles.text}                numberOfLines={1}                adjustsFontSizeToFit>                {location.data.name}</Text></View></Marker>        );      })}</MapView>

Change react-native app display name programatically

$
0
0

there. How can i change react-native app display name programatically ? Is there any way ? I use bare workflow. I want to change app display name at runtime.

React native how to force/override min width / device dpi for my app?

$
0
0

I need to force device dpi to be at least 350px. App is almost unusable with 320dpi devices. I've manually changed dev settings of such devices to higher values and it works ok. Text and other ui stuff is smaller but thats totally acceptable.

Thats the setting I want to override within react native app:enter image description here

App at 392 dpi:enter image description here

At 320 dpi (some screens are worse)enter image description here

"Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral" issue while installing react native on macOS Big Sur

$
0
0

I was trying to install React Native on my system, and found that it failed to install CocoaPods dependencies which is required by that template error.

sudo arch -x86_64 gem install ffi fixed this issue but ended up with event-config.h" file not found error.

I changed the changed the flipper version in pod file to use_flipper!({'Flipper'=>'0.76.0'}) and then I reached to the error mentioned above. Any help on this issue would be appreciated.

node version : 15.10.0react-native version: 0.63.4Xcode version: 12.4

Error description below:

Showing Recent MessagesCould not find or use auto-linked library 'swiftCoreGraphics'Could not find or use auto-linked library 'swiftUIKit'Could not find or use auto-linked library 'swiftDarwin'Could not find or use auto-linked library 'swiftFoundation'Could not find or use auto-linked library 'swiftMetal'Could not find or use auto-linked library 'swiftObjectiveC'Could not find or use auto-linked library 'swiftCoreFoundation'Could not find or use auto-linked library 'swiftDispatch'Could not find or use auto-linked library 'swiftCoreImage'Could not find or use auto-linked library 'swiftQuartzCore'Could not find or use auto-linked library 'swiftCore'Could not find or use auto-linked library 'swiftSwiftOnoneSupport'Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteralUndefined symbol: associated type descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralTypeUndefined symbol: associated conformance descriptor for Swift.ExpressibleByIntegerLiteral.Swift.ExpressibleByIntegerLiteral.IntegerLiteralType: Swift._ExpressibleByBuiltinIntegerLiteralUndefined symbol: method descriptor for Swift.ExpressibleByFloatLiteral.init(floatLiteral: A.FloatLiteralType) -> AUndefined symbol: protocol descriptor for Swift.ExpressibleByIntegerLiteralUndefined symbol: value witness table for Builtin.Int32Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreImageUndefined symbol: associated type descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralTypeUndefined symbol: __swift_FORCE_LOAD_$_swiftQuartzCoreUndefined symbol: __swift_FORCE_LOAD_$_swiftDispatchUndefined symbol: method descriptor for Swift.ExpressibleByIntegerLiteral.init(integerLiteral: A.IntegerLiteralType) -> AUndefined symbol: __swift_FORCE_LOAD_$_swiftCoreFoundationUndefined symbol: protocol witness table for Swift.Int : Swift._ExpressibleByBuiltinIntegerLiteral in SwiftUndefined symbol: __swift_FORCE_LOAD_$_swiftObjectiveCUndefined symbol: __swift_FORCE_LOAD_$_swiftCoreGraphicsUndefined symbol: _swift_getForeignTypeMetadataUndefined symbol: __swift_FORCE_LOAD_$_swiftFoundationUndefined symbol: associated conformance descriptor for Swift.ExpressibleByFloatLiteral.Swift.ExpressibleByFloatLiteral.FloatLiteralType: Swift._ExpressibleByBuiltinFloatLiteralUndefined symbol: __swift_FORCE_LOAD_$_swiftUIKitUndefined symbol: __swift_FORCE_LOAD_$_swiftMetalUndefined symbol: Swift.Float.init(Swift.Double) -> Swift.FloatUndefined symbol: __swift_FORCE_LOAD_$_swiftDarwinUndefined symbol: protocol witness table for Swift.Float : Swift._ExpressibleByBuiltinFloatLiteral in Swift

Add file to LSApplicationQueriesSchemes in your Info.plist WebView React Native

$
0
0

I'm implementing a payment platform in the app that I'm building so the payment form is shown on a WebView Now the form loads okay, but when I change something like I select a payment method from the drop-down web page loads to show options accordingly. But after that refresh it takes me back to the original state as in the page was never changed and throws a warning that reads:

Error opening URL: [Error: Unable to open URL: file:///private/var/containers/Bundle/Application/457E6674-DA77-4676-A2CF-3F21C9572B57/mnopqmobile.app/entry.asp. Add file to LSApplicationQueriesSchemes in your Info.plist.]

While searching for this I've added this in my info.plist file:

<key>LSApplicationQueriesSchemes</key><array><string>file://</string></array>

And here is the WebView component:

<WebView            style={{ flex: 1 }}            useWebKit={true}            source={{ html: paymentGatewayHTMLResponse }}            startInLoadingState={true}            scrollEnabled={true}            javaScriptEnabled={true}            domStorageEnabled={true}            originWhitelist={["file://"]}        />

But it still throws that warning and takes me back to the original page.

My Application crashes immediately on android Emulator after click on login button in react native.However works perfectly fine on iOS Simulator

$
0
0

My Multivendor Food Ordering Application crashes immediately on android Emulator when clicked on login button in react native . However works perfectly fine on iOS Simulator. I am not able to login when i press the login it immediately exits my app to the emulator normal screen. However i have lot of functionalities on Login until a user cannot login he/she is not able to do anything like he/she not able to place an order or pay for the same order. However neither i am getting any error nor any warning on the terminal. Also the Application is not working in Debug mode when I try to launch in Debug mode it gets crashed or killed

How to Trigger video full programmatically in react native application[android and IOS]

$
0
0

I have a YouTube video embedded in a React Native WebView. I'm using the react-native-webview I want to play video without going on fullscreen

<WebViewjavaScriptEnabled={true}scrollEnabled={false}allowsFullscreenVideo={false}userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"source={{ uri: `https://www.youtube.com/embed/LXb3EKWsInQ?autoplay=1&fullscreen=0&allowfullscreen=1`}}style={styles.video}/>

I tried the above code but it's going full screen without the user having to tap the full-screen icon. But I need to go on fullscreen mode when your tab the fullscreen mode

Can't achieve arm64 in iOS

linker command failed with exit code 1 (use -vto see invocation) Xcode

$
0
0

I Working on React Native project and I have issues(warnings & error) build the app on Xcodeenter image description here

Any Clues what's the problem or Maybe solution ?

Viewing all 16907 articles
Browse latest View live