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

Peer to peer connection using ract-native

$
0
0

I am looking to build a Mobile app using react-native that should be able to find nearby phones with the same app installed. At a highlevel, I am looking for something like this:

  1. This app should be able to send a kid of identifier (GUID) via Bluetooth (?) and also listen for signals from other devices in the proximity.
  2. Identify the incoming GUID and calculate very rough distance (may be based on signal strength or something like that)

I am aware of privacy issues and battery issues with this approach. So any ideas into libraries or approaches to achieve the basic discovery will be helpful. Thank you.


How to switch account using GoogleSignIn without sign out?

$
0
0

I am building mobile application with google sign in button. I want to show auth popup everytime I need without signing out before. So user can change his account to another one OR if he changes his mind to switch account when popup is shown he taps back and stays logged in to the previous account.

Right now the behaviour is following:

If user is logged in and he wants to change account, he has to sign out first, because popup is not shown when user already logged in. But I need to give users the possibility to stay logged in when popup is shown again. So they can change their mind and come back and still use services with valid tokens.

I am using React-Native, but solutions for native iOS or Android code would be still ok because RN uses native SDKs under the hood, so I would change native code for both platforms anyway.

Example of flow:

Youtube mobile application. If you're already logged in, you can open settings, tap "Change account" button, see google auth popup (although you're logged in still!), tap "cancel" or back button if you're under Android, continue use app under the user's account.

Apple TV simulator not running on React Native 0.61.4

$
0
0

I created a React Native project with the last version: react-native init project --version 0.61.4 and when I try to run the project on Apple TV simulator I get this error:

ld: library not found for -lPods-ReactNativeTest-tvOS

What I can do to fix this?

Thank you, Claudiu

Custom font not working in React Native

$
0
0

I want to use a font from google fonts in my app. Here is the font.

I have placed the .ttf file in app/fonts.

package.json:

{
    "name": "xxx",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "rnpm": {
        "assets": ["./app/fonts"]
    },
    "jest": {
        "preset": "react-native",
        "moduleNameMapper": {
            "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
            "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
        }
    },
    "dependencies": {
        "flow-typed": "^2.0.0",
        "immutable": "^3.8.1",
        "react": "~15.4.1",
        "react-native": "0.42.0",
        "react-native-vector-icons": "^4.0.0",
        "react-redux": "^5.0.3",
        "redux": "^3.6.0",
        "redux-immutable": "^4.0.0",
        "redux-observable": "^0.14.1",
        "rxjs": "^5.2.0"
    },
    "devDependencies": {
        "babel-eslint": "^7.1.1",
        "babel-jest": "19.0.0",
        "babel-preset-react-native": "1.9.1",
        "eslint": "^3.17.0",
        "eslint-plugin-flowtype": "^2.30.3",
        "eslint-plugin-jsx": "^0.0.2",
        "eslint-plugin-react": "^6.10.0",
        "eslint-plugin-react-native": "^2.3.1",
        "flow-bin": "^0.42.0",
        "jest": "19.0.2",
        "jest-cli": "^19.0.2",
        "react-test-renderer": "~15.4.1",
        "redux-devtools": "^3.3.2",
        "remote-redux-devtools": "^0.5.7"
    }
}

then ran react-native link.

Then use the font in my app:

import { View, Text } from 'react-native'
import React from 'react'
import Width from '../width/Width'
import Shape from '../shape/Shape'
import Height from '../height/Height'
import Thickness from '../thickness/Thickness'

export const Volcalc = () => (
  <View style={styles.container}>
    <Text style={styles.text}>SHAPE</Text>
    <Shape />
    <Text style={styles.text}>HEIGHT</Text>
    <Height />
    <Text style={styles.text}>WIDTH</Text>
    <Width />
    <Text style={styles.text}>THICKNESS</Text>
    <Thickness />
  </View>
)

const $mainColor = '#00d1b2'
const styles = {
  container: {
    flex: 1,
    padding: 20,
    backgroundColor: $mainColor
  },
  text: {
    textAlign: 'center',
    color: 'rgba(255, 255, 255, 0.9)',
    fontSize: 15,
    fontFamily: 'Orbitron'
  }
}

In android it doesn't show the new font but has no error. In ios it has error:

Unrecognised font family "Orbitron"

What am I doing wrong?

How do I find out the EXACT value to place in fontFamily: 'xxx'?

Unable to Retrieve Location

$
0
0

I'm fairly new to React Native but I'm trying to create an application using React Native with React Community Geo location. When I started my application earlier today by running npx react-native run-ios, I was prompted with an update. I believe it updated the iOS emulator version as i am now on 17E255. With this release, I am no longer able to use React Native Geolocation, whenever I try to use geolocation, I am getting an error saying that "PERMISSION_DENIED: 1". I doubled checked that I had my location settings are enabled ( they are). I also tried accessing iOS maps as well, but it was also not able to fetch my location. Was wondering if anyone else knew what to do, do I need to downgrade my iOS version or wait for a fix? Thanks

How to change iOS slider value through Appium/WebdriverIO

$
0
0

I am testing my React Native app using Appium and WebdriverIO. Having difficulty in changing slider values.

Normally in XCUITest I can easily achieve this using the following code:

app.sliders["slider-red"].adjust(toNormalizedSliderPosition: 0)

How to do the equivalent in Appium/WebdriverIO? I read somewhere that I should call sendKeys(). I tried the following:

$('~slider-red').sendKeys(['0']);

But it is giving me the following error:

invalid element state: Error Domain=com.facebook.WebDriverAgent Code=1 "The on-screen keyboard must be present to send keys"

It looks like sendKeys is for input fields, not for sliders!

How to use RegExp in React-Native Webview's injectedJavaScript prop?

$
0
0

When I use regexp in React-Native-Webview's injectedJavaScript prop, an error Unterminated regular expression literal error will be thrown and the regexp will not be honored.

How should I use regexp in injectedJavaScript?If not, is there a workaround I can use?

Minimal reproducible code is below:

// this won't work
<WebView
  source={{ uri: 'https://github.com/ashi009/node-fast-html-parser' }}
  injectedJavaScript={`const regE = /\n|\r/`}
/>

// this won't work as well
<WebView
  source={{ uri: 'https://github.com/ashi009/node-fast-html-parser' }}
  injectedJavaScript={`const regE = new RegExp(/\n|\r/);`}
/>

// this will work
<WebView
  source={{ uri: 'https://github.com/ashi009/node-fast-html-parser' }}
  injectedJavaScript={`const regE = /A*B*C*/`}
/>
  • OS: iOS
  • OS version: 13.3.1
  • react-native version: 0.61.2
  • react-native-webview version: 8.1.2

Check the bug screen below as well.

enter image description here

Full Error Message:

Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string. Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=SyntaxError: Unterminated regular expression literal '/', WKJavaScriptExceptionColumnNumber=0, WKJavaScriptExceptionSourceURL=https://github.com/ashi009/node-fast-html-parser, NSLocalizedDescription=A JavaScript exception occurred}

POD error when trying to use Webstorm for React Native iOS development

$
0
0

I am new to React Native and iOS App development. I come across the following error when I try to run an new reactive native project for iOS:

/usr/local/bin/node /usr/local/lib/node_modules/react-native-cli run-ios
error Could not find "Podfile.lock" at /Users/davep/WebstormProjects/untitled3/ios/Podfile.lock. Did you run "pod install" in iOS directory?
info Found Xcode project "untitled3.xcodeproj"
info Building (using "xcodebuild -project untitled3.xcodeproj -configuration Debug -scheme untitled3 -destination id=CAE67ED1-8877-47D6-826E-376DD2D45250")
................
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project untitled3.xcodeproj -configuration Debug -scheme untitled3 -destination id=CAE67ED1-8877-47D6-826E-376DD2D45250

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Using build description from disk
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the untitled3 editor. (in target 'untitled3' from project 'untitled3')
PhaseScriptExecution Start\ Packager /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Script-FD10A7F022414F080027D42C.sh (in target 'untitled3' from project 'untitled3')
    cd /Users/davep/WebstormProjects/untitled3/ios
    /bin/sh -c /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Script-FD10A7F022414F080027D42C.sh
Connection to localhost port 8081 [tcp/sunproxyadmin] succeeded!

CompileC /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/main.o /Users/davep/WebstormProjects/untitled3/ios/untitled3/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'untitled3' from project 'untitled3')
    cd /Users/davep/WebstormProjects/untitled3/ios
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target x86_64-apple-ios9.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/davep/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/davep/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG=1 -DFB_SONARKIT_ENABLED=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Index/DataStore -iquote /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-generated-files.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-own-target-headers.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-all-target-headers.hmap -iquote /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-project-headers.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Products/Debug-iphonesimulator/include -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources-normal/x86_64 -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources/x86_64 -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources -F/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/main.d --serialize-diagnostics /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/main.dia -c /Users/davep/WebstormProjects/untitled3/ios/untitled3/main.m -o /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/main.o
In file included from /Users/davep/WebstormProjects/untitled3/ios/untitled3/main.m:3:
/Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.h:1:9: fatal error: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

CompileC /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/AppDelegate.o /Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'untitled3' from project 'untitled3')
    cd /Users/davep/WebstormProjects/untitled3/ios
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target x86_64-apple-ios9.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/davep/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/davep/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG=1 -DFB_SONARKIT_ENABLED=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Index/DataStore -iquote /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-generated-files.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-own-target-headers.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-all-target-headers.hmap -iquote /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/untitled3-project-headers.hmap -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Products/Debug-iphonesimulator/include -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources-normal/x86_64 -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources/x86_64 -I/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/DerivedSources -F/Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/AppDelegate.d --serialize-diagnostics /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/AppDelegate.dia -c /Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.m -o /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/AppDelegate.o
In file included from /Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.m:1:
/Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.h:1:9: fatal error: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


** BUILD FAILED **


The following build commands failed:
    CompileC /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/main.o /Users/davep/WebstormProjects/untitled3/ios/untitled3/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC /Users/davep/Library/Developer/Xcode/DerivedData/untitled3-adqqamxzcxmswnfnvithzulzjaop/Build/Intermediates.noindex/untitled3.build/Debug-iphonesimulator/untitled3.build/Objects-normal/x86_64/AppDelegate.o /Users/davep/WebstormProjects/untitled3/ios/untitled3/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening untitled3.xcodeproj. Run CLI with --verbose flag for more details.

I already install the following: * XCode * React Native CLI

May I know what could be going wrong? It seems the Pod install could be a problem?

Many thanks for the help!


AppDelegate.h:8:9: fatal error: 'React/RCTBridgeDelegate.h' file not found #import

$
0
0

I recently added some targets to my React Native project in XCode 10.1

I am using React Native version 0.60.4

I was able to successfully add targets and run pod install, but then when I run react-native run-ios, I get the following build error:

AppDelegate.h:8:9: fatal error: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

This answer did not work for me: React/RCTBridgeDelegate.h' file not found

The file does exist:

enter image description here

And the folder file path also exists in Header Search Paths in XCode.

enter image description here

I did notice React is missing here:

enter image description here

Could the above be the problem? Is it some configuration I am not doing in XCode?

This is my Podfile:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'DEV' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for DEV
  # pod 'AppCenter/Push', '~> 1.3.0'
  pod 'AppCenter/Crashes', '~> 2.0.1'
  pod 'AppCenter/Analytics', '~> 2.0.1'
  pod 'AppCenterReactNativeShared', '~> 2.0.0'

  # Pods for NFIBEngage
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

  target 'NFIBEngageTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'NFIBEngage-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for NFIBEngage-tvOS



end

target 'PROD' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for PROD
  # pod 'AppCenter/Push', '~> 1.3.0'
  pod 'AppCenter/Crashes', '~> 2.0.1'
  pod 'AppCenter/Analytics', '~> 2.0.1'
  pod 'AppCenterReactNativeShared', '~> 2.0.0'

  # Pods for NFIBEngage
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

end

target 'QA' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for QA
  # pod 'AppCenter/Push', '~> 1.3.0'
  pod 'AppCenter/Crashes', '~> 2.0.1'
  pod 'AppCenter/Analytics', '~> 2.0.1'
  pod 'AppCenterReactNativeShared', '~> 2.0.0'

  # Pods for NFIBEngage
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

end

target 'UA' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for UA
  # pod 'AppCenter/Push', '~> 1.3.0'
  pod 'AppCenter/Crashes', '~> 2.0.1'
  pod 'AppCenter/Analytics', '~> 2.0.1'
  pod 'AppCenterReactNativeShared', '~> 2.0.0'

  # Pods for NFIBEngage
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

end

React Native iOS Build - Directory not found for option

$
0
0

Description

I'm doing the build process of my IOS app with the App Center. But it runs pod install and in the next step it uses .xcodeproj instead of .xcworkspace folder. It gives an error of directory not found.

I would like to know why the error is happening with the .xcodeproj file and not with the .xcworkspace folder and what is that error, that will help me to prevent that happens again with other projects.

React Native version:

0.61.2

Steps

1) The installation of pod dependencies works fine

==============================================================================
Task         : CocoaPods
Description  : Install CocoaPods dependencies for Swift and Objective-C Cocoa projects
Version      : 0.151.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
==============================================================================
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.7.5
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update
Updating local specs repositories
....
[!] Please close any current Xcode sessions and use `FastFeet.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 24 dependencies from the Podfile and 25 total pods installed.
The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/lib/ruby/gems/2.6.0/bin/pod'. This may indicate a child process inherited the STDIO streams and has not yet exited.
##[section]Finishing: Pod install

2) Xcode build step uses sgeo.xcodeproj instead sgeo.xcworkspace and uses. That's why it fails and would to know why.

##[section]Starting: Xcode build (not signed)
==============================================================================
Task         : Xcode
Description  : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version      : 4.130.0
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613730)
==============================================================================
[command]/usr/bin/xcodebuild -version
Xcode 10.3
Build version 10G8
##[warning]Output directory for build output (binaries) ignored. Specifying an output directory is incompatible with the 'archive' action.
[command]/usr/bin/xcodebuild -project /Users/vsts/agent/2.155.1/work/1/s/ios/sgeo.xcodeproj -scheme sgeo clean archive -archivePath /Users/vsts/agent/2.155.1/work/1/output/build/archive/sgeo.xcarchive CODE_SIGNING_ALLOWED=NO

...

ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-Core'
ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-DevSupport'

ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-RCTActionSheet'
ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-RCTAnimation'

** ARCHIVE FAILED **


The following build commands failed:
    Ld /Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/IntermediateBuildFilesPath/sgeo.build/Release-iphoneos/sgeo.build/Objects-normal/arm64/sgeo normal arm64
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
##[section]Finishing: Xcode build (not signed)

Expected Results

App Center Build step needs to detect the .xcworkspace folder instead of .xcodeproj, and uses it to the pod install step.

Snack, code example, screenshot, or link to a repository:

https://ibb.co/jWWVjb2

Using React Native Webview with React Native 0.37

$
0
0

I'm trying to install RN Webview as Apple is going to depreciate the existing WebView. I'm having some issues with the installation.

Note: Our project is on RN 0.37 and upgrading cannot be done immediately.

After installing and linking the library, when running we get several import issues.

#import <React/RCTViewManager.h> -> In RNCWebViewManager.h

'React/RCTViewManager.h' file not found

These were resolved by how we import the files.

#import <React/RCTViewManager.h> ->#import "RCTViewManager.h"

This was done for all imports that was imported from React.

After that, we're getting the following errors.

In file included from /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:8: /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:23:29: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] @property (nonatomic, weak) id scriptDelegate; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:23:54: note: insert '_Nullable' if the pointer may be null @property (nonatomic, weak) id scriptDelegate; ^ _Nullable /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:23:54: note: insert '_Nonnull' if the pointer should never be null @property (nonatomic, weak) id scriptDelegate; ^ _Nonnull /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:4: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] - (instancetype)initWithDelegate:(id)scriptDelegate; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:4: note: insert '_Nullable' if the pointer may be null - (instancetype)initWithDelegate:(id)scriptDelegate; ^ _Nullable /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:4: note: insert '_Nonnull' if the pointer should never be null - (instancetype)initWithDelegate:(id)scriptDelegate; ^ _Nonnull /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:35: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] - (instancetype)initWithDelegate:(id)scriptDelegate; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:60: note: insert '_Nullable' if the pointer may be null - (instancetype)initWithDelegate:(id)scriptDelegate; ^ _Nullable /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:24:60: note: insert '_Nonnull' if the pointer should never be null - (instancetype)initWithDelegate:(id)scriptDelegate; ^ _Nonnull /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:108:3: warning: 'UIScrollViewContentInsetAdjustmentBehavior' is only available on iOS 11.0 or newer [-Wunguarded-availability-new]
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior; ^ In module 'UIKit' imported from ../../react-native/React/Views/RCTView.h:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h:35:28: note: 'UIScrollViewContentInsetAdjustmentBehavior' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) { ^ In file included from /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:8: /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.h:27:12: note: annotate 'RNCWebView' with an availability attribute to silence this warning @interface RNCWebView : RCTView ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:394:44: warning: 'UIScrollViewContentInsetAdjustmentBehavior' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] - (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)behavior ^ In module 'UIKit' imported from ../../react-native/React/Views/RCTView.h:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h:35:28: note: 'UIScrollViewContentInsetAdjustmentBehavior' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) { ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:394:1: note: annotate 'setContentInsetAdjustmentBehavior:' with an availability attribute to silence this warning - (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)behavior ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:129:28: error: implicit declaration of function 'RCTSharedApplication' is invalid in C99 [-Werror,-Wimplicit-function-declaration] _savedStatusBarStyle = RCTSharedApplication().statusBarStyle; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:129:50: error: member reference base type 'int' is not a structure or union _savedStatusBarStyle = RCTSharedApplication().statusBarStyle; ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:130:51: error: member reference base type 'int' is not a structure or union _savedStatusBarHidden = RCTSharedApplication().statusBarHidden; ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:138:44: warning: 'UIScrollViewContentInsetAdjustmentNever' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] _savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In module 'UIKit' imported from ../../react-native/React/Views/RCTView.h:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h:35:28: note: 'UIScrollViewContentInsetAdjustmentBehavior' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) { ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:138:44: note: enclose 'UIScrollViewContentInsetAdjustmentNever' in an @available check to silence this warning _savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:270:27: warning: 'setContentInsetAdjustmentBehavior:' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] _webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In module 'UIKit' imported from ../../react-native/React/Views/RCTView.h:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h:68:65: note: 'setContentInsetAdjustmentBehavior:' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 @property(nonatomic) UIScrollViewContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior API_AVAILABLE(ios(11.0),tvos(11.0)); ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:270:27: note: enclose 'setContentInsetAdjustmentBehavior:' in an @available check to silence this warning _webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:308:5: error: implicit declaration of function 'RCTUnsafeExecuteOnMainQueueSync' is invalid in C99 [-Werror,-Wimplicit-function-declaration] RCTUnsafeExecuteOnMainQueueSync(^{ ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:309:8: error: implicit declaration of function 'RCTSharedApplication' is invalid in C99 [-Werror,-Wimplicit-function-declaration] [RCTSharedApplication() setStatusBarStyle:UIStatusBarStyleLightContent animated:YES]; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:309:8: error: bad receiver type 'int' [RCTSharedApplication() setStatusBarStyle:UIStatusBarStyleLightContent animated:YES]; ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:318:5: error: implicit declaration of function 'RCTUnsafeExecuteOnMainQueueSync' is invalid in C99 [-Werror,-Wimplicit-function-declaration] RCTUnsafeExecuteOnMainQueueSync(^{ ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:319:8: error: implicit declaration of function 'RCTSharedApplication' is invalid in C99 [-Werror,-Wimplicit-function-declaration] [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES]; ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:319:8: error: bad receiver type 'int' [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES]; ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:320:8: error: bad receiver type 'int' [RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES]; ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:403:29: warning: 'setContentInsetAdjustmentBehavior:' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] _webView.scrollView.contentInsetAdjustmentBehavior = behavior; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In module 'UIKit' imported from ../../react-native/React/Views/RCTView.h:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h:68:65: note: 'setContentInsetAdjustmentBehavior:' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 @property(nonatomic) UIScrollViewContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior API_AVAILABLE(ios(11.0),tvos(11.0)); ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:403:29: note: enclose 'setContentInsetAdjustmentBehavior:' in an @available check to silence this warning _webView.scrollView.contentInsetAdjustmentBehavior = behavior; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:684:5: error: implicit declaration of function 'RCTJSONStringify' is invalid in C99 [-Werror,-Wimplicit-function-declaration] RCTJSONStringify(eventInitDict, NULL) ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:684:5: warning: format specifies type 'id' but the argument has type 'int' [-Wformat] RCTJSONStringify(eventInitDict, NULL) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1003:61: warning: '&&' within '||' [-Wlogical-op-parentheses] if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102 || [error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 101) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1003:61: note: place parentheses around the '&&' expression to silence this warning if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102 || [error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 101) { ^ ( ) /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1003:137: warning: '&&' within '||' [-Wlogical-op-parentheses] if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102 || [error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 101) { ~~

/Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1003:137:
note: place parentheses around the '&&' expression to silence this
warning
    if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102 || [error.domain
isEqualToString:@"WebKitErrorDomain"] && error.code == 101) {
                                                                                                                                        ^
                                                                                    (                                                                     
)
/Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1221:11:
error: implicit declaration of function 'RCTJSONStringify' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
          RCTJSONStringify(cookie.name, NULL),
          ^ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1221:11:
warning: format specifies type 'id' but the argument has type 'int'
[-Wformat]
          RCTJSONStringify(cookie.name, NULL),
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1222:11:
warning: format specifies type 'id' but the argument has type 'int'
[-Wformat]
          RCTJSONStringify(cookie.value, NULL)];
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/projects/myapp/test-webview/ios-app/node_modules/react-native-webview/ios/RNCWebView.m:1224:54:
warning: format specifies type 'id' but the argument has type 'int'
[-Wformat]
          [script appendFormat:@" + '; Path=' + %@", RCTJSONStringify(cookie.path, NULL)];
                                                ~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                %d 14 warnings and 12 errors generated.

How do we resolve this?

Environment:

  • OS: Mac
  • OS version: Catalina 10.15.3
  • react-native version: 0.37
  • react-native-webview version: 9.0.2

Peer to peer connection using react-native

$
0
0

I am looking to build a Mobile app using react-native that should be able to find nearby phones with the same app installed. At a highlevel, I am looking for something like this:

  1. This app should be able to send a kid of identifier (GUID) via Bluetooth (?) and also listen for signals from other devices in the proximity.
  2. Identify the incoming GUID and calculate very rough distance (may be based on signal strength or something like that)

I am aware of privacy issues and battery issues with this approach. So any ideas into libraries or approaches to achieve the basic discovery will be helpful. Thank you.

How to get rid of app icons from appearing on Share?

$
0
0

How do i exclude the Instagram and iOS Messaging app icon from displaying in Share? I can't find the string to disable it in ExcludedActivityTypes

import { Share } from 'react-native' 
. 
.
.

const result = await Share.share(

      {
        message: 'Check it out',
        title: "hey",
        url: "www.image....."
      },
      {
        // iOS only:
        excludedActivityTypes: [
                                'com.apple.UIKit.activity.PostToTwitter',
                                'com.apple.UIKit.activity.PostToWeibo',
                                'com.apple.UIKit.activity.Print',
                                'com.apple.UIKit.activity.CopyToPasteboard',
                                'com.apple.UIKit.activity.AssignToContact',
                                'com.apple.UIKit.activity.SaveToCameraRoll',
                                'com.apple.UIKit.activity.AddToReadingList',
                                'com.apple.UIKit.activity.PostToFlickr',
                                'com.apple.UIKit.activity.PostToVimeo',
                                'com.apple.UIKit.activity.PostToTencentWeibo',
                                'com.apple.UIKit.activity.AirDrop',
                                'com.apple.UIKit.activity.OpenInIBooks',
                                'com.apple.UIKit.activity.MarkupAsPDF',
                                'com.apple.reminders.RemindersEditorExtension',
                                'com.apple.mobilenotes.SharingExtension',
                                'com.apple.mobileslideshow.StreamShareService',
                                'com.linkedin.LinkedIn.ShareExtension',
                                'pinterest.ShareExtension',
                                'com.google.GooglePlus.ShareExtension',
                                'com.tumblr.tumblr.Share-With-Tumblr',
                                'net.whatsapp.WhatsApp.ShareExtension',
                                'com.facebook.Facebook.ShareExtension',

                               ],
      },
    )

A bonus would also be to get rid of 'Save To Files' button

Thanks

Pause certain notifications when app is closed (vehicle tracking)

$
0
0

I am developing a vehicle tracking application and am trying to implement functionality to notify users when a vehicle arrives at defined geofences.

I need to restrict notifications so that the user only receives them if they're actively tracking a vehicle in the app (they have to select which vehicle to track manually).

So far I've created a notification topic for each vehicle using Firebase's Topic Messaging. When the user presses the vehicle, the user is subscribed to that topic. When the user stops tracking the vehicle, they are unsubscribed from the topic.

This works very well. However, if the user force closes the app without leaving tracking mode using the interface, they continue to receive notifications even whilst the app is closed.

How can I unsubscribe the user from the vehicle topic if they force close the app, or change the implementation so that I can still provide the user with vehicle update notifications, but only when they've enabled tracking?

Add image instead of string title to react-native-segmented-control-tab

$
0
0

I'm using react-native-segmented-control-tab in my project and it works fine. Below is my current code

<SegmentedControlTab
                tabsContainerStyle={styles.tabsContainerStyle}
                tabStyle={styles.tabStyle}
                activeTabStyle={styles.activeTabStyle}
                values={["First", "Second", "Third"]}
                selectedIndex={this.state.selectedIndex}
                onTabPress={this.handleIndexChange}
              />

This displays segment with title string "First, Second and Third". Now instead of these strings, I would like to replace them with images. Is that possible? How do I go about it?


React Native apps can be upgraded to Kotlin and Swift [closed]

$
0
0

I have a company that has an application in the Google store and another one in the Apple store, both are created in React Native, but they no longer want to continue using it and want to switch to the native languages of the platforms, Kotlin and Swift respectively. However, I have the doubt if I will be able to update both versions without problems to the native languages in each of the stores, since I have never had to do something like this. That is, will the updates of the apps from one technology to another be carried out without problems?

Can not connect to localhost api using React Native app run on real device iOS

$
0
0

I have been developing a React Native with a rails API running on localhost:3000. I have one endpoint only because I am using graphQL with Apollo Client, so I connect to the api with http://localhost:3000/graphql.

I am now trying to run the app on my own iPhone - connected via lightning cable. The app loads correctly but I am getting [Network error]: Network request failed. So having researched all I could, I changed localhost to my computer's IP address, so the endpoint I am trying is now http://192.168.20.75:3000/graphql. However I am still getting the same error.

Xcode output is also showing NSErrorFailingURLStringKey=http://192.168.20.75:3000/graphql.

The IP address is correct, as that's what I see in system preferences network section and also I can see that when React Native is loading the JS, it tells me it's "Loading from 192.168.20.75:8081". When I ran ifconfig I also see inet 192.168.20.75 netmask 0xffffff00 broadcast 192.168.20.255. I also tried 192.168.20.255 FWIW and no luck.

A different React Native app I worked on a couple of years ago worked when I had did this so I am really stumped trying to work out why this isn't working. Any suggestions would be much appreciated!

How do i exclude the Instagram button from Share?

$
0
0

I would like to exclude Instagram icon from the list of icons presented when using react native Share.Share(). It just looks awful when posting items. How do i add it to the list below?

       excludedActivityTypes: [
                                'com.apple.UIKit.activity.PostToTwitter',
                                'com.apple.UIKit.activity.PostToWeibo',
                                'com.apple.UIKit.activity.Print',
                                'com.apple.UIKit.activity.CopyToPasteboard',
                                'com.apple.UIKit.activity.AssignToContact',
                                'com.apple.UIKit.activity.SaveToCameraRoll',
                                'com.apple.UIKit.activity.AddToReadingList',
                                'com.apple.UIKit.activity.PostToFlickr',
                                'com.apple.UIKit.activity.PostToVimeo',
                                'com.apple.UIKit.activity.PostToTencentWeibo',
                                'com.apple.UIKit.activity.AirDrop',
                                'com.apple.UIKit.activity.OpenInIBooks',
                                'com.apple.UIKit.activity.MarkupAsPDF',
                                'com.apple.reminders.RemindersEditorExtension',
                                'com.apple.mobilenotes.SharingExtension',
                                'com.apple.mobileslideshow.StreamShareService',
                                'com.linkedin.LinkedIn.ShareExtension',
                                'pinterest.ShareExtension',
                                'com.google.GooglePlus.ShareExtension',
                                'com.tumblr.tumblr.Share-With-Tumblr',
                                'net.whatsapp.WhatsApp.ShareExtension',
                                //'com.facebook.Facebook.ShareExtension',

                               ],

How do i know when i've clicked a specific app icon when Sharing?

$
0
0

I'm using 'Share' from React Native. How do i know when the application has been clicked? I want to know as soon as a user clicks an app icon (e.g. Instagram) and then launch my own function, not the share page in instagram. How can i capture that the user has just clicked the app icon?

Right now if i click the app icon, it moves to the app's (e.g. Instagram's) share page, and when i dismiss it, then it tells me what my sharedAction was (which is too late!). I don't want to have to enter the share page at all.

I need to know when i've selected the Instagram app icon, so i can launch my own function.

import { Share } from 'react-native' 

shareImage = async() => {

    const result = await Share.share(

      {
        message: 'Hello',
        url: "www.image...."
      },
    )
    .then(res => console.log(res))


    if (result.action === Share.sharedAction) {
      if (result.activityType) {
        // shared with activity type of result.activityType
      } else {
        // shared
      }
    } else if (result.action === Share.dismissedAction) {
      // dismissed
    }
}

See image here

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

$
0
0

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

Viewing all 16907 articles
Browse latest View live


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