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

React native vector icons and ios

$
0
0

I cannot get react-native-vector icons to work and I've tried everything:

  • Linking it and not linking it because it says it's autolinked
  • I've done pod install
  • Added the Fonts folder, added everything to info.plist
  • Tried with a new project but it didn't work
  • Tried building it in Xcode
  • Tried using legacy build

After all of this if i run it without linking it i get "Unrecognized font family" and if I try to run it when linked it just won't build


CDN: trunk URL couldn't be downloaded in certain React Native project when running "pod install"?

$
0
0

I have this react native project that im working with multiple computers, in my MacBook everything works fine, when I run "pod install" after running "npm install" the pods project is created successfully, in the other hand when I do the same in my desktop I get this following error:

enter image description here

Ive tried installing pods for other projects and everything works fine, the problem is with this project in particular.

mapbox gl - Pbf layer not working in android

$
0
0

I m using react native mapbox gl and added pbf tile like :

<MapboxGL.VectorSource   id="idTestSoruce"  tms={true}   tileUrlTemplates={["url@EPSG:900913_1024@pbf/{z}/{x}/{y}.pbf"]}><MapboxGL.FillLayer       id="idTestLayer"      sourceID="idTestSoruce"      sourceLayerID="plotm"      style={{ visibility: "visible", fillColor: "red"}}       minZoomLevel={12}       maxZoomLevel={22}    /></MapboxGL.VectorSource>

Version info:

react-native: 0.59.10@react-native-mapbox-gl/maps: 7.0.8

It is working perfectly in ios but in android getting following error:

Error while updating property 'tms' of a view managed by: RCTMGVectorSource

Unhandled JS Exception: ReferenceError: Can't find variable: i 【what is " i " !?!?】react navigation

$
0
0

I am using react native 0.61.5 version.

What is "i"?

Hello " i "I looked for "i" in my project.But, as far as I can tell, I couldn't find any mistakes.

I commented out App.tsx.Then commented out the following part and the error disappeared. The same error occurs even if you remove the comment out of the same description.

// const HomeScreen = ({navigation}) => {//   return (//     <HomeStack.Navigator>//       <HomeStack.Screen//         name="Home"//         component={Home}//         options={{//           headerLeft: () => HeaderDrawer(navigation),//         }}//       />//     </HomeStack.Navigator>//   );// };

From this, I realized that react navigation v5 was bad.

Someone please give me informationIf you are in the same situation, we will ask for information.

Update Async Storage when app is in background or swiped out React Native

$
0
0

I have a scenario in my React Native app where I have to store notifcations into my local storage. I am using react-native-storage library. When I receive the notification when app is in foreground I receive a callback. When the app is in background I receive the notification on the status bar but no callback is called. How can I manage to register a callback when there is a notification for my application in background? After that I will be able to store into the device local storage.

I am using react-native-onesignal for push notifications

AppCenter react native ios build fails:"The following build commands failed: CopyPlistFile"

$
0
0

My app is built with react native.
I use Xcode 11 for development, and App Center for build.
I manage to build+archive the app (and run it on my device) when I build it locally on my mac.
However, when I build the app on App Center I get the following error:

The following build commands failed: CopyPlistFile /Users/runner/Library/Developer/Xcode/DerivedData/MyApp-glnwmpshuhlwezeyiaupgnbnizsy/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/GoogleService-Info.plist /Users/runner/runners/2.160.1/work/1/GoogleService-Info.plist (1 failure) [error]Error: /usr/bin/xcodebuild failed with return code: 65

I made sure that I am using legacy build system on App Center (just like on the local).

React-Native: Get X and Y coordinates of draggable Object using panResponder.panHandlers (nativeElement)

$
0
0

I am developing an app, which provides the design of Different shapes like Square and Circle, I have used the following Library

https://www.npmjs.com/package/react-native-draggable
At the time of creating my drawing view its working fine, but at the time of edit that drawing, I want to move Circle and Square from its previous saved position to its new position, but when I am trying to set my previous last position from the DB, I can't get perfect position of X and Y.enter image description here

When I debug, I am getting touch position of the object, not the X and Y position of the object

this is my code :

  1. I used draggable class for creating an object Draggable,

  2. In my Component :

    <Draggable                       renderSize={68}                       renderColor='rad'                       x={80.80097961425781}                       y={72.79156494140625}                       renderText='B'                       pressDrag={()=>alert('touched!!')}                       pressDragRelease={({ nativeEvent }) => { console.log(nativeEvent);}}                       reverse={false}                   />

Here is my Question:
1. How can I get X and Y from nativeElement,
'nativeElement` property are : nativeEvent

ChangedTouches - Array of all touch events that have changed since the last eventidentifier - The ID of the touchlocationX - The X position of the touch, relative to the elementlocationY - The Y position of the touch, relative to the elementpageX - The X position of the touch, relative to the root elementpageY - The Y position of the touch, relative to the root elementtarget - The node id of the element receiving the touch eventtimestamp - A time identifier for the touch, useful for velocity calculationtouches - Array of all current touches on the screen

How to change background colour transparent in React-Native checkBox?

$
0
0

In my scenario, I am trying to implement react native check box for android and iOS using Reactnative Elements. Here, I need to change checkbox with label background colour. It is showing full white but how to change it is transparent?

https://react-native-elements.github.io/react-native-elements/docs/checkbox.html

<CheckBox  checkedIcon={<Image source={require('../checked.png')} />}  uncheckedIcon={<Image source={require('../unchecked.png')} />}  checked={this.state.checked}  onPress={() => this.setState({checked: !this.state.checked})}/>

Linking app error ld: 42 duplicate symbols for architecture x86_64

$
0
0

Im getting 42 duplicate symbols for architecture x86_64, I have no clue how to fix it.

enter image description here

iOS React Native: Add build configuration other than Debug and Release

$
0
0

I'm working on a react native project, by default they are two build configurations (Debug and Release) that works just fine. However, when i create a new build configuration by duplicating the Release configuration and then try to run the application targeting the created build configuration, i get the following error:

fatal error: module map file 'PathToBuildFolder/Stage-iphoneos/YogaKit/YogaKit.modulemap' not found

Stage is the name of the created build configuration, any idea how i can solve this ?

Thx

Building a ci/cd pipeline for react-native ios app: How to run expo build in gitlab-ci?

$
0
0

I am helping set up a gitlab ci pipeline for a react-native application that was developed with expo. Here is my gitlab-ci.yml:

image: node/aplinecache:  key: ${CI_COMMIT_REF_SLUG}  paths:    - ~/.npmstages:  - deploy  - tagbefore_script:  - echo $CI_BUILD_REF  - echo $CI_PROJECT_DIR  - apk add --no-cache bash build-base gcc git python3 curl  - PATCH=`git log --pretty=oneline | wc -l | sed -e 's/^[[:space:]]*//'`  - VERSION=`cat VERSION`  - VERSION=${VERSION%?}  - TAG="${VERSION}${PATCH}"  - echo "Build version = ${TAG}"expo-build:  stage: deploy  artifacts:    paths:    - ipas/  script:    - sed -i "s/0.0.0/${TAG}/g" app.json    - npm ci --production --cache .npm --prefer-offline    - npx expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD    - EXPO_DEBUG=true npx expo build:ios --non-interactive    - mkdir -p ipas    - curl "$(npx expo url:ipa --non-interactive)" -o ipas/my-app-$TAG.ipa  only:    - master

What I am trying to do is have the app build a new .ipa every time there is a push to master. That way I can upload the .ipa to my mdm to distribute the application.

The problem is that if I every build a different app (I have multiple applications I am trying to do this with), it appears the build step needs to be run locally before it can be run in ci again. What I mean is that the command npx expo build:ios --non-interactive needs intervention in selecting the proper certificates every time I make a separate build utilizing my apple credentials.

Here is the output from a failed build (that had succeed in the pipeline before without code changes):

- Making sure project is set up correctly...[17:26:33] Checking if there is a build in progress...[17:26:34] Fetching available credentials[17:26:38] Unable to validate distribution certificate due to insufficient Apple Credentials[17:26:38] Unable to determine validity of Push Keys due to insufficient Apple Credentials[17:26:38] CommandError: Input is required, but Expo CLI is in non-interactive mode.Required input:> Push Notifications Key (Key ID: XXX, Team ID: XXX)>     not used by any apps>     ✅ Currently valid on Apple's servers. >  Would you like to use this Push Key?   at prompt (/expo-cli@3.17.17/src/prompt.ts:22:11)   at CreateOrReusePushKey.open (/expo-cli@3.17.17/src/credentials/views/IosPushCredentials.ts:281:31)   at processTicksAndRejections (internal/process/task_queues.js:97:5)   at CredentialsManager.run (/expo-cli@3.17.17/src/credentials/route.ts:42:12)   at runCredentialsManager (/expo-cli@3.17.17/src/credentials/route.ts:13:10)   at IOSBuilder.produceCredentials (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:168:7)   at IOSBuilder.prepareCredentials (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:124:7)   at IOSBuilder.run (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:46:7)   at IOSBuilder.command (/expo-cli@3.17.17/src/commands/build/BaseBuilder.ts:29:7)   at Command.<anonymous> (/expo-cli@3.17.17/src/exp.ts:85:7) { code: 'NON_INTERACTIVE', isCommandError: true}[17:26:39] Failed to prepare all credentials. The next time you build, we will automatically use the following configuration:[17:26:39][17:26:39] Project Credential Configuration:[17:26:39]   Experience: @team/app, bundle identifier: com.app.profile[17:26:39]     Provisioning profile (ID: XXX)[17:26:39]     Apple Team ID: XXX,  Apple Team Name: ---------[17:26:39][17:26:39]   Distribution Certificate - Certificate ID: XXX[17:26:39]     Apple Team ID: XXX,  Apple Team Name: A Company, LLC (In-House)[17:26:39]     used by     @team/app, (com.app.profile)[17:26:39] [17:26:39] Error   at CredentialsManager.doQuit [as _quit] (/expo-cli@3.17.17/src/credentials/views/Select.ts:176:9)   at CredentialsManager.run (/expo-cli@3.17.17/src/credentials/route.ts:49:42)   at runCredentialsManager (/expo-cli@3.17.17/src/credentials/route.ts:13:10)   at IOSBuilder.produceCredentials (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:168:7)   at IOSBuilder.prepareCredentials (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:124:7)   at IOSBuilder.run (/expo-cli@3.17.17/src/commands/build/ios/IOSBuilder.ts:46:7)   at IOSBuilder.command (/expo-cli@3.17.17/src/commands/build/BaseBuilder.ts:29:7)   at Command.<anonymous> (/expo-cli@3.17.17/src/exp.ts:85:7)

my question is: is this workflow supported by expo/gitlab-ci, and if so what am I doing wrong? I would like this to build reliably so I can develpo a solid ci/cd pipeline for this react-native application. If there is a better process for me to follow for this use case (building and deploying a react-native ios app) I am all ears as well. Anything helps.

What is the meaning of 'No bundle URL present' in react-native?

$
0
0

When I run a react-native project, I get a error no bundle URL present , but I don't know what mistakes I do, I was very confused.

enter image description here

Recreating react native Disabling dark mode not working (ios)

$
0
0

I am trying to prevent app from using dark mode because text becomes white on a white background

These solution for darkmode have not worked for me:

I add this to my Info.plist file: (this does nothing)

<key>UIUserInterfaceStyle</key><string>Light</string>

I tried this in my AppDelegate.m: (give me build errors)

    if (@available(iOS 13.0, *)) {        rootView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;    }

Can't access to camera through react-native-webview

$
0
0

I am using react-native-webview version 4.0.2 . So I have a webview that contains an add button that allows us to take picture with the camera but when clicking at that button nothing is shown and no camera permission shown : this is on android side but working very well on ios (i can see permission and access to camera ) . In my AndroidManifest.xml i do have :

<uses-permission android:name="android.permission.CAMERA" /><uses-feature android:name="android.hardware.camera"      android:required="false"/><uses-feature android:name="android.hardware.camera.autofocus"     android:required="false"/> 

So please do you have any suggestion ?

How to persist page name and validate it every time app reopen using react native?

$
0
0

In myscenario, I am having three different screen like Page1, Page2, Page3. Here, if user last visited page 2 then next time if user open application, instead of showing page1 need to show page2. How to achieve this using react native application?

I tried by using async storage but don’t know how to manage multiple page

AsyncStorage.getItem("alreadyLaunched").then(value => {            if(value == null){                 AsyncStorage.setItem('alreadyLaunched', true); // No need to wait for `setItem` to finish, although you might want to handle errors                 this.setState({firstLaunch: true});            }            else{                 this.setState({firstLaunch: false});            }}) // Add some error handling, also you can simply do this.setState({fistLaunch: value == null})

Cloud or hosting with MacOS for develop React Native app

$
0
0

I am developing React Native app on Linux Debian 10 but I cannot install Xcode and run 'pod install' for develop for ios.Could you recommend cloud or hosting with installed MacOS? Unexpensive or free.Or another solution of my problem?

Building a very simple mobile application (no mobile dev experience)

$
0
0

I'm quite skilled with Java, Python, C++, etc. but have never done mobile development. I have used React to develop a web application before, however.

For a job, as a take-home exercise they have asked me to develop a very simple mobile application which lets the user input two numbers x and y and then show a shape with the number of sides being equal to the sum of x and y (e.g. if x = 2 and y = 3 then show a pentagon).

How can I achieve this? I don't have any mobile development experience but I really want to achieve this task.

There is no specific language stated to use (however, their company uses React Native, Firebase, Node.js and JavaScript)

How to detect application first launch in react native app?

$
0
0

In my scenario, I am having three different screens like Page1, Page2, Page3. Here, if the user last visited page 2 then next time if user open application, instead of showing page1 need to show page2. How to achieve this using a react-native application?

I tried by using async storage but don’t know how to manage multiple pages

AsyncStorage.getItem("alreadyLaunched").then(value => {            if(value == null){                 AsyncStorage.setItem('alreadyLaunched', true); // No need to wait for `setItem` to finish, although you might want to handle errors                 this.setState({firstLaunch: true});            }            else{                 this.setState({firstLaunch: false});            }}) // Add some error handling, also you can simply do this.setState({fistLaunch: value == null})

App.js

import { createAppContainer } from 'react-navigation';import { createStackNavigator} from 'react-navigation-stack';import FirstPage from './pages/FirstPage';import SecondPage from './pages/SecondPage';import ThirdPage from './pages/ThirdPage';//import all the screens we are going to switch const App = createStackNavigator({   //Constant which holds all the screens like index of any book    FirstPage: { screen: FirstPage, header: null},   SecondPage: { screen: SecondPage,  headerLeft: null, headerBackTitle: null},    ThirdPage: { screen: ThirdPage},   },  {    initialRouteName: 'FirstPage',  });export default createAppContainer(App);

unable to open file (in target "React" in project "Pods") (in target 'React')

$
0
0

I have one reactNative project and i am trying to run in latest xcode 10.1.But its throwing two error while i building.

error :

Users/ios/Pods/Target Support Files/React/React.xcconfig: unable to open file (in target "React" in project "Pods") (in target 'React')Users/ios/Pods/Target Support Files/React/React.xcconfig: unable to open file (in target "React" in project "Pods") (in target 'React')

my pod file is like below :

 source 'https://github.com/CocoaPods/Specs.git'platform :ios, '9.0'EXPO_CPP_HEADER_DIR = 'ExpoKit'target 'commonalityre' do  pod 'ExpoKit',    :git => "http://github.com/expo/expo.git",    :tag => "ios/2.6.8",    :subspecs => ["Core","CPP","GL"    ],    :inhibit_warnings => true  pod 'React',    :path => "../node_modules/react-native",    :inhibit_warnings => true,    :subspecs => ["Core","ART","RCTActionSheet","RCTAnimation","RCTCameraRoll","RCTGeolocation","RCTImage","RCTNetwork","RCTPushNotification","RCTText","RCTVibration","RCTWebSocket","DevSupport","CxxBridge"    ]  pod 'yoga',    :path => "../node_modules/react-native/ReactCommon/yoga",    :inhibit_warnings => true

Not sure how can i solve this. I tried deleting derived data, and clean, nothing help. Still i am getting this error.

Thanks

Detect webview with PHP ios

$
0
0

i know this question been asked a lot and i searched before but was not able to find a way to detect ios webview in php

react native app that on an app page i use webview and i want to display some information when this webpage is loaded from my react native app

for android i have done it like this and it work

if($_SERVER['HTTP_X_REQUESTED_WITH'] == "com.appp.app") 

now for ios $_SERVER['HTTP_X_REQUESTED_WITH return null

i have tried

$_SERVER['HTTP_USER_AGENT']

other answers found here was not able to set only for app it is also detect safari

i need only to detect app

thanks for the help

Viewing all 16907 articles
Browse latest View live


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