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

React native expo implementing Apple App Tracking Transparency (ATT) for iOS 14.5

$
0
0

What is the best way of implementing the Apple App Transparency Tracker (ATT) feature on react native expo? My app keeps getting rejected by apple even after I add:

app.json file :

"infoPlist": {"NSUserTrackingUsageDescription": "App requires permission...."}

Where is the iOS build folder located for React Native apps?

$
0
0

I have just built an iOS React Native app, but I can't locate the app or .ipa file.

Google doesn't seem to have many answers and in Xcode, the folder is just labelled as 'build'.

I need to upload the .ipa file to Microsoft App Center. Where should I look for the app?

Update

I found this: How to build .ipa application for react-native-ios?

Seems like they missed some bits out int the RN docs!

How to make all pages in react native RTL?

$
0
0

There is a way to make all the screens in the application RTL display, or I have to do it for each screen?

convert AppDelegate.m to AppDelegate.swift

$
0
0

I'm adding PayPal payment to my React Native application but in the project documentation is used AppDelegate.m instead AppDelegate.swift

How i can use this page in swift?

AppDelegate.m:

#import "RNPaypal.h"- (BOOL)application:(UIApplication *)application   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  [[RNPaypal sharedInstance] configure];}// if you support only iOS 9+, add the following method- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url  options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{  return [[RNPaypal sharedInstance] application:application openURL:url options:options];}// otherwise, if you support iOS 8, add the following method- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{  return [[RNPaypal sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];}

Thx!

React native map crashes when deploy app to Testflight (iOS)

$
0
0

I have a page in my app that is supposed to show a map and track the location of the user displaying a blue line behind the person. when I try out the app on expo it works perfectly but after Uploading it to testflight and testing, when I open this page, the app crashes. here is my code. maybe one can point out to the issue would be great.

    /** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */import React, { useEffect, useState } from "react";import * as Permissions from 'expo-permissions';import {  StyleSheet,  View,  Text,  TouchableOpacity,  Platform,  PermissionsAndroid} from "react-native";import MapView, {  Marker,  AnimatedRegion,  Polyline,  PROVIDER_GOOGLE} from "react-native-maps";import haversine from "haversine";import { func } from "prop-types";import firebase from 'firebase';import {db} from '../App';// const LATITUDE = 29.95539;// const LONGITUDE = 78.07513;const LATITUDE_DELTA = 0.009;const LONGITUDE_DELTA = 0.009;const LATITUDE = 37.78825;const LONGITUDE = -122.4324;import * as Location from 'expo-location';class AnimatedMarkers extends React.Component {  constructor(props) {    super(props);    this.state = {      latitude: LATITUDE,      longitude: LONGITUDE,      routeCoordinates: [],      distanceTravelled: 0,      prevLatLng: {},      useNativeDriver: true,      coordinate: new AnimatedRegion({        latitude: LATITUDE,        longitude: LONGITUDE,        latitudeDelta: 0,        longitudeDelta: 0,        useNativeDriver: true      })    };  }  // new  async getLocationAsync() {    // permissions returns only for location permissions on iOS and under certain conditions, see Permissions.LOCATION    const { status, permissions } = await Permissions.askAsync(Permissions.LOCATION);    if (status === 'granted') {      return Location.getCurrentPositionAsync({ enableHighAccuracy: true });    } else {      throw new Error('Location permission not granted');    }  }  // new  componentDidMount() {    const { coordinate } = this.state;    // new    this.getLocationAsync();     // new    this.watchID = navigator.geolocation.watchPosition(      position => {        const { routeCoordinates, distanceTravelled } = this.state;        const { latitude, longitude } = position.coords;        const newCoordinate = {          latitude,          longitude        };        if (Platform.OS === "android") {          if (this.marker) {            this.marker._component.animateMarkerToCoordinate(              newCoordinate,              500            );          }        } else {          coordinate.timing(newCoordinate).start();        }        // aqui upload to Firebase        const user = firebase.auth().currentUser;        var date = new Date().getDate();        var month = new Date().getMonth() + 1;        var year = new Date().getFullYear();        let fullDate = date +'-'+ month +'-'+ year;        db.ref('/users/'+user.uid+'/'+fullDate).push().set({latitude: latitude,longitude: longitude,})            .then(() => console.log('Data set.'));        this.setState({          latitude,          longitude,          routeCoordinates: routeCoordinates.concat([newCoordinate]),          distanceTravelled:            distanceTravelled + this.calcDistance(newCoordinate),          prevLatLng: newCoordinate        });      },      error => console.log(error),      {        enableHighAccuracy: true,        timeout: 20000,        maximumAge: 1000,        distanceFilter: 10      }    );  }  componentWillUnmount() {    navigator.geolocation.clearWatch(this.watchID);  }  getMapRegion = () => ({    latitude: this.state.latitude,    longitude: this.state.longitude,    latitudeDelta: LATITUDE_DELTA,    longitudeDelta: LONGITUDE_DELTA  });  calcDistance = newLatLng => {    const { prevLatLng } = this.state;    return haversine(prevLatLng, newLatLng) || 0;  };  handleViaje = () => {    var date = new Date().getDate();    var month = new Date().getMonth() + 1;    var year = new Date().getFullYear();    let fullDate = date +'-'+ month +'-'+ year;    const { distanceTravelled } = this.state;    const user = firebase.auth().currentUser;    var data = {        isActive: "false"    }    let nuevaDistancia = distanceTravelled;    db.ref('/users/'+user.uid+'/distancias/'+fullDate).on('value', (snapshot) => {        const userObj = snapshot.val();        console.log('puto');        nuevaDistancia = nuevaDistancia + userObj.distancia;    })    db.ref('/users/'+user.uid+'/distancias/'+fullDate+'/').update({distancia: nuevaDistancia})    db.ref('/users/'+user.uid+'/isActive').update(data)    // getting the time    let d = new Date();    let hours = d.getHours();    let minutes = d.getMinutes();    let seconds = d.getSeconds() + minutes*60 + hours*60*60;    let totalSeconds = 0;    db.ref('/users/'+user.uid+'/tripTempInformation').on('value', (snapshot) => {        const userObj = snapshot.val();        let prevSecond = userObj.seconds;        totalSeconds = seconds - prevSecond;    });    db.ref('/users/'+user.uid+'/tiempos/'+fullDate+'/').push({seconds: totalSeconds});    //update    let seconValues = 0;    db.ref('/users/'+user.uid+'/tiempos/'+fullDate+'/').on('value', (snapshot) => {        const userObj = snapshot.val();        for(let obj in userObj){            db.ref('/users/'+user.uid+'/tiempos/'+fullDate+'/'+obj).on('value', (snapshot) => {                if(snapshot.val().seconds){                    seconValues = seconValues + snapshot.val().seconds;                }            });        }    });    db.ref('/users/'+user.uid+'/tiempos/'+fullDate+'/').update({seconds: seconValues});    // end here    this.props.navigation.navigate("Home")}  render() {    return (<View style={styles.container}><MapView          style={styles.map}          provider={PROVIDER_GOOGLE}          showUserLocation          followUserLocation          loadingEnabled          region={this.getMapRegion()}><Polyline coordinates={this.state.routeCoordinates} strokeWidth={5} /><Marker.Animated            ref={marker => {              this.marker = marker;            }}            coordinate={this.state.coordinate}          /></MapView><View style={styles.buttonContainer}><TouchableOpacity style={[styles.bubble, styles.button]}><Text style={styles.bottomBarContent}>              {parseFloat(this.state.distanceTravelled).toFixed(2)} km</Text></TouchableOpacity><TouchableOpacity style={styles.button2} onPress={this.handleViaje}><Text style={{color: "#FFF", fontWeight: "500"}}>Terminar Viaje</Text></TouchableOpacity></View></View>    );  }}const styles = StyleSheet.create({  container: {    ...StyleSheet.absoluteFillObject,    justifyContent: "flex-end",    alignItems: "center"  },  map: {    ...StyleSheet.absoluteFillObject  },  bubble: {    flex: 1,    backgroundColor: "rgba(255,255,255,0.7)",    paddingHorizontal: 18,    paddingVertical: 12,    borderRadius: 20  },  latlng: {    width: 200,    alignItems: "stretch"  },  button: {    width: 80,    paddingHorizontal: 12,    alignItems: "center",    marginHorizontal: 10  },  buttonContainer: {    flexDirection: "row",    marginVertical: 20,    backgroundColor: "transparent"  },  button2: {    marginHorizontal: 30,    backgroundColor: "#E9446A",    borderRadius: 4,    height: 52,    alignItems: "center",    justifyContent: "center"},});export default AnimatedMarkers;

Module 'BrightcovePlayerSDK' not found after upgrading to 0.63

$
0
0

I have just upgraded to React Native 0.63 and can no longer build my app due to the following error

Module 'BrightcovePlayerSDK' not found

I tried adding it as a custom pod in my podfile but this did not work. Instead i have followed the instructions here https://github.com/brightcove/brightcove-player-sdk-ios to install manually. This now gives me the error

No visible @interface for 'BCOVOfflineVideoManager' declares the selector 'requestVideoDownload:parameters:completion:'

I have checked the framework search path is correct but i'm not sure what this error means.

I have just upgraded to Xcode 12.5 and here is my podfile now:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'platform :ios, '10.0'target 'ProjectcNameApp' do  config = use_native_modules!  use_react_native!(:path => config["reactNativePath"])  target 'ProjectcNameAppTests' do    inherit! :complete    # Pods for testing  end  # Enables Flipper.  #  # Note that if you have use_frameworks! enabled, Flipper will not work and  # you should disable these next few lines.  # use_flipper!  # post_install do |installer|  #   flipper_post_install(installer)  # endend```

React Native - Disable Password AutoFill Option on iOS Keyboard

$
0
0

In React Native, how do you disable or prevent the keyboard from displaying the Password Autofill accessory view option? There doesn't seem to be an property for TextInput that handles disabling this option. React Native TextInput Documentation. I am also using Expo on top of React Native.

Password AutoFill was introduced in iOS 11

Image of Password AutoFill Accessory view option

Here is a post that has a solution for disabling the password autofill accessory, but how can we achieve this using React Native?

iOS 11 disable password autofill accessory view option?

Can someone share the experience of migrating an app from React Native to Flutter? [closed]

$
0
0

We have an app built on React Native. Initially, we developed it only for iOS and published it in App Store.

Now, we consider two option:

  1. Audit and adaptation for Android
  2. Change the technology stack to Flutter

The app is not very big and complex, it has about 25 screens and an online video component based on the Twilio library. We don't face any issues with performance for now.

Could someone share the experience of migration from RN to Flutter? Was it worth it?

Thanks a lot.


React Native error on react-native run-android

$
0
0

I am trying to run a React Native Project and it's throwing the following error on react-native run-android.

I have a RN project for version 0.60.4 , to upgrade to version 0.63.3 I created a new project with version 0.63.3 and copied all the files from old project RN Version 0.60.4 to new RN project with version 0.63.3.

After doing the above step its throwing the following error.

Can anyone please help me out as why the issue exists.

Following are the logs:

[Wed May 05 2021 17:04:41.331]  WARN     Require cycle: node_modules/react-native-firebase/dist/utils/apps.js -> node_modules/react-native-firebase/dist/modules/core/app.js -> node_modules/react-native-firebase/dist/utils/apps.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.332]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/admob/index.js -> node_modules/react-native-firebase/dist/modules/admob/Interstitial.js -> node_modules/react-native-firebase/dist/modules/admob/index.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.332]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/admob/index.js -> node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js -> node_modules/react-native-firebase/dist/modules/admob/index.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.333]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/database/Reference.js -> node_modules/react-native-firebase/dist/utils/SyncTree.js -> node_modules/react-native-firebase/dist/modules/database/Reference.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.334]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/core/firebase.js -> node_modules/react-native-firebase/dist/utils/apps.js -> node_modules/react-native-firebase/dist/modules/core/app.js -> node_modules/react-native-firebase/dist/modules/database/index.js -> node_modules/react-native-firebase/dist/modules/core/firebase.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.334]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/firestore/DocumentSnapshot.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentSnapshot.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.334]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/firestore/CollectionReference.js -> node_modules/react-native-firebase/dist/modules/firestore/Query.js -> node_modules/react-native-firebase/dist/modules/firestore/QuerySnapshot.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentChange.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentSnapshot.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js -> node_modules/react-native-firebase/dist/modules/firestore/CollectionReference.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.335]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js -> node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js -> node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.335]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js -> node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js -> node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.336]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/core/firebase.js -> node_modules/react-native-firebase/dist/utils/apps.js -> node_modules/react-native-firebase/dist/modules/core/app.js -> node_modules/react-native-firebase/dist/modules/functions/index.js -> node_modules/react-native-firebase/dist/modules/core/firebase.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.336]  WARN     Require cycle: node_modules/react-native-firebase/dist/modules/storage/index.js -> node_modules/react-native-firebase/dist/modules/storage/reference.js -> node_modules/react-native-firebase/dist/modules/storage/task.js -> node_modules/react-native-firebase/dist/modules/storage/index.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.337]  WARN     Require cycle: node_modules/react-native-paper/src/components/FAB/FAB.js -> node_modules/react-native-paper/src/components/FAB/FABGroup.js -> node_modules/react-native-paper/src/components/FAB/FAB.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.337]  WARN     Require cycle: node_modules/react-native-paper/src/components/Appbar/Appbar.js -> node_modules/react-native-paper/src/components/Appbar/AppbarHeader.js -> node_modules/react-native-paper/src/components/Appbar/Appbar.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.337]  WARN     Require cycle: node_modules/react-native-paper/src/components/ToggleButton/ToggleButton.js -> node_modules/react-native-paper/src/components/ToggleButton/ToggleButtonGroup.js -> node_modules/react-native-paper/src/components/ToggleButton/ToggleButton.jsRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.[Wed May 05 2021 17:04:41.338]  ERROR    TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style')[Wed May 05 2021 17:04:41.338]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)[Wed May 05 2021 17:04:41.339]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

Package.json

{"name": "FunnyAppName","version": "0.0.1","private": true,"scripts": {"android": "react-native run-android","ios": "react-native run-ios","start": "react-native start","test": "jest","lint": "eslint ."  },"dependencies": {"@yfuks/react-native-action-sheet": "^0.0.5","axios": "^0.19.0","lodash": "^4.17.15","moment": "^2.24.0","native-base": "^2.13.4","prop-types": "^15.7.2","react": "16.13.1","react-native": "0.63.2","react-native-appstore-version-checker": "^3.0.0","react-native-check-box": "^2.1.7","react-native-check-version": "^1.0.8","react-native-complete-flatlist": "^1.1.34","react-native-countdown-component": "^2.5.2","react-native-country-picker-modal": "^2.0.0","react-native-device-info": "^2.3.2","react-native-document-picker": "^4.1.1","react-native-dropdown": "^0.0.6","react-native-dropdown-picker": "^3.7.8","react-native-easy-grid": "^0.2.1","react-native-elements": "^1.1.0","react-native-firebase": "^5.5.6","react-native-flip-toggle-button": "^1.0.9","react-native-floating-action": "^1.21.0","react-native-gesture-handler": "^1.3.0","react-native-hr": "^1.1.4","react-native-image-picker": "^1.0.2","react-native-loading-spinner-overlay": "^2.0.0","react-native-localization": "^2.1.5","react-native-material-dropdown": "^0.11.1","react-native-material-menu": "^1.1.3","react-native-modal": "^11.3.1","react-native-modal-datetime-picker": "^7.5.0","react-native-multiple-choice": "^0.0.8","react-native-multiple-select": "^0.5.3","react-native-multiple-select-list": "^1.0.4","react-native-paper": "^2.16.0","react-native-picker-select": "^6.3.0","react-native-razorpay": "^2.2.4","react-native-reanimated": "^2.1.0","react-native-render-html": "^5.0.0","react-native-screens": "^3.1.1","react-native-select-contact": "^1.2.1","react-native-select-multiple": "^2.0.0","react-native-selectme": "^1.2.3","react-native-simple-radio-button": "^2.7.3","react-native-simple-toast": "^1.1.3","react-native-sqlite-storage": "^5.0.0","react-native-table-component": "^1.2.0","react-native-textarea": "^1.0.3","react-native-vector-icons": "^7.0.0","react-native-version-check": "^3.4.2","react-native-version-info": "^1.1.0","react-native-view-more-text": "^2.1.0","react-native-web-swiper": "^1.16.2","react-native-webview": "^7.5.2","react-native-youtube": "^2.0.1","react-navigation": "^3.11.1","reactstrap": "^8.0.1","rn-fetch-blob": "^0.10.16","rn-multiple-choice": "^0.0.5","toggle-switch-react-native": "^2.0.0"  },"devDependencies": {"@babel/core": "^7.14.0","@babel/runtime": "^7.14.0","@react-native-community/eslint-config": "^2.0.0","babel-jest": "^26.6.3","eslint": "^7.25.0","jest": "^26.6.3","metro-react-native-babel-preset": "^0.66.0","react-test-renderer": "16.13.1"  },"jest": {"preset": "react-native"  }}

Thanks in advance.

SDK Version Issue on iOS testflight

$
0
0

I'm trying to initiate the testflight for my iOS application, suddenly I'm started getting the below error

"SDK Version Issue. This app was built with the iOS 13.2 SDK. All iOS apps submitted to the App Store must be built with the iOS 14 SDK or later, included in Xcode 12 or later."

After googling a bit, I found that few people are facing the same and like other developers, I don't want to upgrade the xcode as many other applications are dependent on it and I am using xcode 11.0.1 and to upgrade the xcode to higher version, I need to upgrade my macOS as well, I am using mojave and I have to upgrade it to Bigsur.

As I'm a cross-platform developer, I have very little idea about these processes, so please help with a proper solution

Failed to run react native on iOS after upgrading Xcode 12.5

$
0
0

Trying to start react native project on iOS simulator whit MacBook Air M1 failed with this error

:0: error: module map file '/Users/userName/Library/Developer/Xcode/DerivedData/projectName-czhmfookabhyqzdsutttonzlxnsi/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap'not found
:0: error: module map file'/Users/erName/Library/Developer/Xcode/DerivedData/projectName-czhmfookabhyqzdsutttonzlxnsi/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap'not found
:0: error: missing required module 'SwiftShims'

** BUILD FAILED **

The following build commands failed:

CompileSwift normal x86_64 [path-to-project-folder]/ios/File.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

I've already tried to

  • open .xcworkspace with Xcode
  • delete node_modules, package-lock.json, and podfile.lock;
  • npm install;
  • pod install inside iOS folder
  • clean DerivedData folder
  • rebuild project

INFO #

System:    OS: macOS 11.3     CPU: (8) arm64 Apple M1     Memory: 177.69 MB / 8.00 GB     Shell: 5.8 - /bin/zsh   Binaries:     Node: 15.14.0 - /opt/homebrew/bin/node     npm: 7.7.6 - /opt/homebrew/bin/npm     Watchman: 4.9.0 - /opt/homebrew/bin/watchman   SDKs:     iOS SDK:       Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4     Android SDK:       API Levels: 27, 28, 29, 30      Build Tools: 28.0.3, 29.0.2, 30.0.3       System Images: android-29 | Automotive with Play Store Intel x86 Atom, android-29 | Android TV Intel x86 Atom, android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom   IDEs:     Android Studio: 4.1 AI-201.8743.12.41.7199119     Xcode: 12.5/12E262 - /usr/bin/xcodebuild   npmPackages:     react: 16.9.0 => 16.9.0      react-native: ^0.61.5 => 0.61.5    npmGlobalPackages:     react-native-cli: 2.0.1 

Pod file

platform :ios, '10.0'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'target '[tName]' do  permissions_path = '../node_modules/react-native-permissions/ios'  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"  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/jscallinvoker', :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'  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'  pod 'GoogleSignIn', '~> 5.0.2'  # react-native-geolocation-service  pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'  # use_frameworks!  pod 'TwitterKit5'#  google idfa support  pod 'GoogleIDFASupport', '~> 3.14'  target '[tNameTests]' do    inherit! :search_paths    # Pods for testing  end  use_native_modules!#  GOOGLE MAPS REQUIRE  rn_maps_path = '../node_modules/react-native-maps'   pod 'react-native-google-maps', :path => rn_maps_path   pod 'GoogleMaps'   pod 'Google-Maps-iOS-Utils'end  target '[tName]-tvOS' do   # Pods for [tName]-tvOS   target '[tName]-tvOSTests' do     inherit! :search_paths     # Pods for testing   endend post_install do |installer|     ## Fix for XCode 12.5 beta     find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")     find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm","RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") end def find_and_replace(dir, findstr, replacestr)   Dir[dir].each do |name|      text = File.read(name)      replace = text.gsub(findstr,replacestr)       if text != replace           puts "Fix: " + name           File.open(name, "w") { |file| file.puts replace }           STDOUT.flush       end   end   Dir[dir +'*/'].each(&method(:find_and_replace)) end

React Native (iOS) save file to directory & open with option

$
0
0

I have two question;

1) I want to save a file on my app like screenshots above. I checked react-native-fs and react-native-document-picker libraries but they can't help me about this issue. (or I can't find these options)

  • When user click to share button I want to open this menu.
  • And when user select Save to Files(Dosyalar'a Kaydet) option I want to open this menu with file creation option (up right corner icon)

Is there any library for these actions? Or how can I create these modules?


2) Is there any way to add our app to 'Open with' menu? I mean let's say we have any '.txt' extension file and we want to open it with our app.

Example screenshots:

SS_1

User selects More(Daha Fazla)

SS_2

EDIT: The solution package is: https://github.com/react-native-share/react-native-share

How to remove the line divider in the 'react-native-calendar-picker' after selecting a date range

$
0
0

I'm implementing the allowRangeSelection in https://www.npmjs.com/package/react-native-calendar-picker but the problem is the vertical line divider is present between the Tuesday, Wednesday and Thursday ,Friday when selecting a range date as seen in the image.

Does anyone know how to remove the vertical line or this is a known issue in the library?

I tried putting borderSize: 0 in selectedRangeStyle but still not working.

Here is the code:

<CalendarPicker  ref={props.forwardedRef}  previousComponent={<MaterialIcons      name="keyboard-arrow-left"      size={22}      style={{ color: app.color.TEXT_100_HIGH, marginLeft: scale(18) }}    />  }  nextComponent={<MaterialIcons      name="keyboard-arrow-right"      size={22}      style={{ color: app.color.TEXT_100_HIGH, marginRight: scale(18) }}    />  }  textStyle={{ color: app.color.TEXT_300_HIGH, fontWeight: "bold" }}  todayBackgroundColor="transparent"  todayTextStyle={app.color.currentDayCalendarText}  disabledDatesTextStyle={{ color: "#445870" }}  customDayHeaderStyles={() => {    return {      textStyle: { color: app.color.TEXT_200_MEDIUIM, opacity: 1 },    };  }}  dayLabelsWrapper={{    borderTopWidth: 0,    borderBottomWidth: 0,    marginLeft: scale(40),  }}  startFromMonday={true}  selectedRangeStartStyle={{    backgroundColor: app.color.calendarDefaultDateColor,  }}  selectedRangeEndStyle={{    backgroundColor: app.color.calendarDefaultDateColor,  }}  selectedRangeStyle={{    backgroundColor: app.color.calendarDefaultDateColor,  }}  selectedDayColor={app.color.calendarDefaultDateColor}  selectedDayTextColor={"#FFFFFF"}/>

Sample picture of the calendar

Do I need to create res folder manually in react-native?

$
0
0

If I'm working in a react-native project.

Do I have to create res folder with all the fonts, images and static content?orDoes react-native compile and create res folder with all the assets for me?

React-native do this for both Android and iOS?

Thanks

Swift._ArrayBuffer._copyContents on Xcode

$
0
0
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libAlamofire.a(NetworkReachabilityManager.o)ld: symbol(s) not found for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)

I upgrade Xcode 12.5 with ios 14.5 version. and I tried to excute my app...and I got an above problem... I don't know how to solve this problem. does anyone who solve this ???


multiple commands produce error in xcode 11.4 react native my copy bundle resources are empty

$
0
0

following is the error in xcodeI have also tried build legacy from workspace settings but failed to do so.

Multiple commands produce '/Users/saifubaid/Library/Developer/Xcode/DerivedData/antispam-bjwrxskogxnnophfhgkpyxxcqcuj/Build/Intermediates.noindex/ArchiveIntermediates/antispam/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':

  1. Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/saifubaid/Library/Developer/Xcode/DerivedData/antispam-bjwrxskogxnnophfhgkpyxxcqcuj/Build/Intermediates.noindex/ArchiveIntermediates/antispam/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
  2. Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/saifubaid/Library/Developer/Xcode/DerivedData/antispam-bjwrxskogxnnophfhgkpyxxcqcuj/Build/Intermediates.noindex/ArchiveIntermediates/antispam/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'stuck on it. tried almost every solution.

React Native Maps Expo IOS not rendering current location

$
0
0

I am new to mobile development and I am building an application that renders a map of the users current location and my goal is to dynamically set the coordinates based on the current location of the user. I am building it in React Native Expo for IOS and testing on an iphone 12 pro max IOS 14.5 emulator. Currently, I have the map displayed and have been able to log the coordinates for my current location, however the map only renders the default location of San Francisco. If I hardcode the coordinates, it will render the hardcoded location. I have tried using setTimeOut incase it was a loading issue but it was unsuccessful. I am using google maps and have included the API key in my app.json file. Has anyone else experienced this issue that could provide insight?

import React, { useState, useEffect, useCallback } from 'react';import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';import { StyleSheet, Text, View, Button, SafeAreaView, Dimensions } from 'react-native';import * as Location from 'expo-location';import * as Permissions from 'expo-permissions';function Map({ navigation }){    const [errorMsg, setErrorMsg] = useState(null)    const [region, setRegion] = useState(null);    useEffect(() => {       ( async () => {          let { status } = await Location.requestForegroundPermissionsAsync();          if (status !== 'granted') {            setErrorMsg('Permission to access location was denied');            return;          }            let location = await Location.getCurrentPositionAsync({});          const curLoc = {            latitude: location.coords.latitude,            longitude: location.coords.longitude,            latitudeDelta: 0.01,            longitudeDelta: 0.01          }          setRegion(region => curLoc)        })()      }, []);      let text = 'Waiting..';      if (errorMsg) {        text = errorMsg;      } else if (location) {        text = JSON.stringify(location);      }      return(<SafeAreaView >          { !region && <Text>Loading...</Text>}            {region && <MapView            provider={PROVIDER_GOOGLE}            style={styles.map}            showsUserLocation={true}            initialRegion={region}             />}</SafeAreaView> )}export default Map;const styles = StyleSheet.create({    map: {      width: Dimensions.get('window').width,      height: Dimensions.get('window').height,    },  });

How to fix pod install error glog is too old or missing react native ios in windows 10

$
0
0

I wanted to detach expo in my expo project to get the bare react native project after expo detach i run pod install bring me this error that during installing glog that script is too old or is missing

[!] C:/Program Files/Git/usr/bin/bash.exe -cset -e#!/bin/bash# Copyright (c) Facebook, Inc. and its affiliates.## This source code is licensed under the MIT license found in the# LICENSE file in the root directory of this source tree.set -ePLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"CURRENT_ARCH="${CURRENT_ARCH}"if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then    # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.    # it's better to rely on platform name as fallback because architecture differs between simulator and device    if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then        CURRENT_ARCH="x86_64"    else        CURRENT_ARCH="armv7"    fifiexport CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"export CXX="$CC"# Remove automake symlink if it existsif [ -h "test-driver" ]; then    rm test-driverfi./configure --host arm-apple-darwin# Fix build for tvOScat << EOF >> src/config.h/* Add in so we have Apple Target Conditionals */#ifdef __APPLE__#include <TargetConditionals.h>#include <Availability.h>#endif/* Special configuration for AppleTVOS */#if TARGET_OS_TV#undef HAVE_SYSCALL_H#undef HAVE_SYS_SYSCALL_H#undef OS_MACOSX#endif/* Special configuration for ucontext */#undef HAVE_UCONTEXT_H#undef PC_FROM_UCONTEXT#if defined(__x86_64__)#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip#elif defined(__i386__)#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip#endifEOF# Prepare exported header includeEXPORTED_INCLUDE_DIR="exported/glog"mkdir -p exported/glogcp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for arm-apple-darwin-strip... nochecking for strip... nochecking for a thread-safe mkdir -p... /usr/bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... nochecking whether make supports nested variables... nochecking for arm-apple-darwin-gcc...  -arch armv7 -isysrootchecking whether the C compiler works... no/usr/bin/bash: line 24: xcrun: command not found/usr/bin/bash: line 24: xcrun: command not found/c/Users/DOZEN/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-aefd1/missing: Unknown `--is-lightweight' optionTry `/c/Users/DOZEN/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-aefd1/missing --help' for more informationconfigure: WARNING: 'missing' script is too old or missingconfigure: error: in `/c/Users/DOZEN/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-aefd1':configure: error: C compiler cannot create executablesSee `config.log' for more details

i use react-native: 0.59.10and my podfile

platform :ios, '10.0'require_relative '../node_modules/react-native-unimodules/cocoapods'target 'UdahiliPortal' do  # Pods for UdahiliPortal  pod 'React', :path => '../node_modules/react-native', :subspecs => ['Core','CxxBridge','DevSupport','RCTActionSheet','RCTAnimation','RCTBlob','RCTGeolocation','RCTImage','RCTLinkingIOS','RCTNetwork','RCTSettings','RCTText','RCTVibration','RCTWebSocket',  ]  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'  pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'  pod 'RNReanimated', :podspec => '../node_modules/react-native-reanimated/RNReanimated.podspec'  pod 'RNScreens', :path => '../node_modules/react-native-screens'  use_unimodules!end

in Mac I find out thy fix this error by

sudo xcode-select --switch /Applications/Xcode.app

but this does not work on window help please

How to set custom fonts in WebView(react-native-webview) in iOS?

$
0
0

I want to set custom fonts in Webview. I have implemented the below code:

@font-face {    font-family: 'Poppins-Bold';     src:url('file:///android_asset/fonts/Poppins-Bold.ttf') format('truetype')}body{    font-family: Poppins-Bold    margin: 0;    padding: 0;    color: red;}

It works fine in android, but it does not working in iOS. Let me know if anybody has a solution for this.

Note: I don't want to use google's CSS font

React native image resizeMode set to "contain" , on Android the image not showing

$
0
0

After trying for couple of days with lots of trial and error I had found that the issue is caused when I use < Image > component with props resizeMode="contain". If I use resizeMode="cover" , the issue is not there. However, I need that props in order to place the image properly and it seems the only option.By the way, resizeMode="contain" works perfectly on IOS.

Viewing all 16907 articles
Browse latest View live


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