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

Send / submit button not calling linked function in React Native

$
0
0

The button in the example below doesn't seem to be calling the function linked to it when the keyboard is up / TextInput is on focus. It does work when the keyboard is down, though.

My best guess is that when the TextInput is on focus, the first press on the button is being used to shift focus away from the TextInput (although, not typical behaviour) and any subsequent presses on the button fire up the linked function. Which may also explain why the function does get called on every press event when the keyboard is down.

function msgInputHandler() {    console.log("Test");  }<View style={styles.msgInputContainer}><TextInput    placeholder="Message..."    style={[styles.search, { width: "85%" }]}  /><Pressable onPress={msgInputHandler}>        <Ionicons name="arrow-up-circle" size={40} color="orange" />       </Pressable></View>

I have removed all the state updating code from the example above, all of which is irrelevant to the problem.

The button is supposed to be pressed by the users after entering some text into the input field which should then initiate an API call. Therefore, it can be assumed that the button will only be clicked when the keyboard is up.


React Native upgrade 0.73 Undefined symbols: _OBJC_CLASS_$_RCTEventDispatcher,

$
0
0

During the process of updating RN to 0.73. I am running into this issue on the app center ios pipeline.

ld: Undefined symbols:  _OBJC_CLASS_$_RCTEventDispatcher, referenced from:      __OBJC_$_CATEGORY_RCTEventDispatcher_$_Reanimated in libRNReanimated.a[15](RCTEventDispatcher+Reanimated.o)       in libreact-native-video.a[14](RCTVideoManager-4f7ca5ff0fe771e512e596f87e56773d.o)clang: error: linker command failed with exit code 1 (use -v to see invocation)
The following build commands failed:    Ld /Users/runner/Library/Developer/Xcode/DerivedData/fluzclient-giqtbliqeqmefvddlqenjaszepez/Build/Intermediates.noindex/ArchiveIntermediates/fluzclient/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ImageNotification.appex/ImageNotification normal (in target 'ImageNotification' from project 'fluzclient')(1 failure)##[error]Error: /usr/bin/xcodebuild failed with return code: 65

My podfile

# Resolve react_native_pods.rb with node to allow for hoistinguse_modular_headers!def node_require(script)  # Resolve script with node to allow for hoisting  require Pod::Executable.execute_command('node', ['-p',"require.resolve('#{script}',      {paths: [process.argv[1]]},    )", __dir__]).stripendnode_require('react-native/scripts/react_native_pods.rb')node_require('react-native-permissions/scripts/setup.rb')ENV['SWIFT_VERSION'] = '5.7'def fluz_pods  pod 'react-native-orientation-locker', :path => '../node_modules/react-native-orientation-locker'  pod 'react-native-branch', path: '../node_modules/react-native-branch'  pod 'FullStory', :http => 'https://ios-releases.fullstory.com/fullstory-1.43.1-xcframework.tar.gz'  pod 'CocoaLumberjack/Swift'endplatform :ios, '14.0'prepare_react_native_project!setup_permissions(['AppTrackingTransparency','Bluetooth','Calendars','CalendarsWriteOnly','Camera','Contacts','FaceID','LocationAccuracy','LocationAlways','LocationWhenInUse','MediaLibrary','Microphone','Motion','Notifications','PhotoLibrary','PhotoLibraryAddOnly','Reminders','SpeechRecognition','StoreKit',])# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded## To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`# ```js# module.exports = {#   dependencies: {#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),# ```flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabledlinkage = ENV['USE_FRAMEWORKS']if linkage != nil  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green  use_frameworks! :linkage => linkage.to_symenddef guard_pods_deployment_target(installer)  # implements __apply_Xcode_12_5_M1_post_install_workaround with ios 12.0  installer.pods_project.targets.each do |target|    if target.name != "Braintree"      # we skip Braintree packages for target upgrade      # "error: 'unarchiveObjectWithData:' is deprecated: first deprecated in iOS 12.0"      target.build_configurations.each do |config|        #  "error: thread-local storage is not supported for the current target"        # The most reliable known workaround is to bump iOS deployment target.        # ensure IPHONEOS_DEPLOYMENT_TARGET is at least 14        should_upgrade = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].split('.')[0].to_i < 14        if should_upgrade          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14'        end      end    end    if target.name == "Braintree"      # apply only to Braintree to prevent      # "error: 'unarchiveObjectWithData:' is deprecated: first deprecated in iOS 12.0"      target.build_configurations.each do |config|        #  "error: thread-local storage is not supported for the current target"        # The most reliable known workaround is to bump iOS deployment target.        # ensure IPHONEOS_DEPLOYMENT_TARGET is at least 14.0        should_upgrade = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].split('.')[0].to_i < 14.0        if should_upgrade          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'        end      end    end    if target.name == 'Flipper'      file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'      contents = File.read(file_path)      unless contents.include?('#include <functional>')        File.open(file_path, 'w') do |file|          file.puts('#include <functional>')          file.puts(contents)        end      end    end  end  # But... doing so caused another issue in Flipper:  #   "Time.h:52:17: error: typedef redefinition with different types"  # We need to make a patch to RCT-Folly. @0.66.3  # See https://github.com/facebook/flipper/issues/834 for more details.  `sed -i -e  $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_14_0)//' Pods/RCT-Folly/folly/portability/Time.h`endtarget 'fluzclient' do  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks  # use_frameworks!  config = use_native_modules!  use_react_native!(    :path => config[:reactNativePath],    # Enables Flipper.    #    # Note that if you have use_frameworks! enabled, Flipper will not work and    # you should disable the next line.    :flipper_configuration => flipper_config,    # An absolute path to your application root.    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  # Pods for fluzclient  fluz_pods  target 'fluzclientTests' do    inherit! :complete    # Pods for testing  endendtarget 'fluzclient-staging' do  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks  # use_frameworks!  config = use_native_modules!  use_react_native!(    :path => config[:reactNativePath],    # Enables Flipper.    #    # Note that if you have use_frameworks! enabled, Flipper will not work and    # you should disable the next line.    :flipper_configuration => flipper_config,    # An absolute path to your application root.    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  # Pods for fluzclient  fluz_podsendconfig = use_native_modules!pre_install do |installer|  installer.pod_targets.each do |pod|    if pod.name.eql?('RNReanimated')      def pod.build_type        Pod::BuildType.static_library      end    end  endendpost_install do |installer|  installer.pods_project.targets.each do |target|    if target.name == "React-Core.common-CoreModulesHeaders-RCTI18nStrings"      target.remove_from_project    end    target.build_configurations.each do |config|      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'    end  end  # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202  react_native_post_install(    installer,    config[:reactNativePath],    :mac_catalyst_enabled => false  )  guard_pods_deployment_target(installer)  installer.pods_project.targets.each do |target|     target.build_configurations.each do |config|       config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']     end   endendtarget 'ImageNotification' do  platform :ios, '14.0'  pod 'Firebase/Messaging'  pod 'Iterable-iOS-AppExtensions'end

Many people say that it is related to use_framework and that adding a pre_install with a explicit type to static library would fix it but it did not for me. I am pretty sure that RNReanimated is what i need to target but am i wrong?

    pre_install do |installer|     installer.pod_targets.each do |pod|       if pod.name.eql?('RNReanimated')         def pod.build_type           Pod::BuildType.static_library         end       end      end    end
  • I have also tried removing use_modular_headers!
  • upgrading react-native-video but I end up getting a different error.
  • upgrading react-native-reanimated
  • adding RNReanimated to the ImageNotification target like below
target 'ImageNotification' do  platform :ios, '14.0'  pod 'Firebase/Messaging'  pod 'Iterable-iOS-AppExtensions'  pod 'RNReanimated'end

Custom Button in React Navigation Wix Bottom Tab

$
0
0

I'm using React Navigation Wix for my App and I want to achieve something similar to the below design (Attached image).

Actually the problem with the wix is that we don't have the ability to customize too much things, we can config the text and the icon only.

Note that its hard for me to convert to the react navigation library right now.

enter image description here

How can I show notification actions by default

$
0
0

I am developing an app with react native and expo-notifications. The notifications have 2 notification buttons that are shown once the user long-presses the notification.

Is it possible for those actions/buttons to be shown by default without the user having to long press the notification?

I am willing to write a native plugin for it to work, but so far I haven't found anything that would suggest it being possible.

Once I install a TestFlight build on top of the version of the app from the App Store, all data from App Store version is gone

$
0
0

https://stackoverflow.com/questions/33539534/testflight-alert-while-testing-update-you-already-have-this-app-installed

I currently have the exact same issue as the problem I linked here. I deleted Application.getIosIdForVendorAsync() and replace it for Device.modelId After that i create a new TestFlight version and I install it on top of the App Store version. And still the data is been deleted. And if I go back to the App Store version, the data appears again. I still don´t know what is causing the issue, but it's been imposible for me find debugging what it might be causing the problem.Also the Application.getIosIdForVendorAsync() was been used on the registration process only, so theres no way that it was causing the issue of deleting the data. As I said before, i deleted it just in case.

Disable zoom on web-view react-native?

$
0
0

How to disable zoom on react-nativeweb-view,is there a property like hasZoom={false}(just an example) that can be included in the below web-view tag that can disable zooming.It has to be working on both android and ios.

<WebView     ref={WEBVIEW_REF}     source={{uri:Environment.LOGIN_URL}}     ignoreSslError={true}     onNavigationStateChange={this._onNavigationStateChange.bind(this)}     onLoad={this.onLoad.bind(this)}     onError={this.onError.bind(this)}></WebView> 

Getting unnecessary log while adding NotificationService Extension in IOS

$
0
0

I am using react native for an app.Just added NotificationService Extension for rich notifications and trying building my project

Getting these unnecessary log in console when hit to run on simulator.

1)tried cleaning the derived data.

2)pod deintegrate and integrate.

3)closing xcode and reopening again.

These types of logs getting

export HEADER_SEARCH_PATHS=/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/include\ \ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/AppAuth/AppAuth.framework/Headers"\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/BVLinearGradient/BVLinearGradient.framework/Headers"\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/Base64/Base64.framework/Headers"\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/CleverTapSDK.framework/Headers"\.............................................................................................................................

Upgrading OpenSSL-Universal 1.1.1100 to 1.1.2300 on iOS React Native

$
0
0

I need to updrade OpenSSL-Universal 1.1.1100 to 1.1.2300 on iOS React Native.

Here are my pod install logs

Installing BEMCheckBox (1.4.1)Installing BVLinearGradient (2.8.2)Installing CocoaAsyncSocket (7.6.5)Installing DoubleConversion (1.1.6)Installing FBLazyVector (0.72.7)Installing FBReactNativeSpec (0.72.7)Installing Firebase (10.27.0)Installing FirebaseCore (10.27.0)Installing FirebaseCoreInternal (10.28.0)Installing FirebaseDynamicLinks (10.27.0)Installing Flipper (0.182.0)Installing Flipper-Boost-iOSX (1.76.0.1.11)Installing Flipper-DoubleConversion (3.2.0.1)Installing Flipper-Fmt (7.1.7)Installing Flipper-Folly (2.6.10)Installing Flipper-Glog (0.5.0.5)Installing Flipper-PeerTalk (0.0.4)Installing FlipperKit (0.182.0)Installing GoogleUtilities (7.13.3)Installing OpenSSL-Universal (1.1.1100)Installing PromisesObjC (2.4.0)Installing RCT-Folly (2021.07.22.00)Installing RCTRequired (0.72.7)Installing RCTTypeSafety (0.72.7)Installing RNCAsyncStorage (1.19.2)Installing RNCCheckbox (0.5.16)Installing RNCClipboard (1.11.2)Installing RNDeviceInfo (10.13.2)Installing RNFBApp (20.1.0)Installing RNFBDynamicLinks (20.1.0)Installing RNGestureHandler (2.13.4)Installing RNKeychain (8.1.2)Installing RNLocalize (2.2.6)Installing RNNotifee (7.8.2)Installing RNPermissions (4.1.5)Installing RNSVG (13.11.0)Installing RNScreens (3.24.0)Installing RNScreenshotPrevent (1.1.7)Installing RNSentry (5.22.2)Installing React (0.72.7)Installing React-Codegen (0.72.7)Installing React-Core (0.72.7)Installing React-CoreModules (0.72.7)Installing React-NativeModulesApple (0.72.7)Installing React-RCTActionSheet (0.72.7)Installing React-RCTAnimation (0.72.7)Installing React-RCTAppDelegate (0.72.7)Installing React-RCTBlob (0.72.7)Installing React-RCTImage (0.72.7)Installing React-RCTLinking (0.72.7)Installing React-RCTNetwork (0.72.7)Installing React-RCTSettings (0.72.7)Installing React-RCTText (0.72.7)Installing React-RCTVibration (0.72.7)Installing React-callinvoker (0.72.7)Installing React-cxxreact (0.72.7)Installing React-debug (0.72.7)Installing React-hermes (0.72.7)Installing React-jsi (0.72.7)Installing React-jsiexecutor (0.72.7)Installing React-jsinspector (0.72.7)Installing React-logger (0.72.7)Installing React-perflogger (0.72.7)Installing React-rncore (0.72.7)Installing React-runtimeexecutor (0.72.7)Installing React-runtimescheduler (0.72.7)Installing React-utils (0.72.7)Installing ReactCommon (0.72.7)Installing Sentry (8.25.0)Installing SocketRocket (0.6.1)Installing TouchID (4.4.1)Installing VisionCamera (3.8.2)Installing Yoga (1.14.0)Installing YogaKit (1.18.1)Installing boost (1.76.0)Installing fmt (6.2.1)Installing glog (0.3.5)Installing hermes-engine (0.72.7)Installing libevent (2.1.12)Installing react-native-biometrics (3.0.1)Installing react-native-blur (4.3.2)Installing react-native-get-random-values (1.9.0)Installing react-native-quick-crypto (0.7.0-rc.10)Installing react-native-render-html (6.3.4)Installing react-native-restart (0.0.27)Installing react-native-safe-area-context (4.7.1)Installing react-native-splash-screen (3.3.0)Installing react-native-webview (11.26.1)

No matter what I Do, it always seems to install 1.1.1100.

Any ideas?


Expo: How to add a "folder reference" to the iOS Xcode project

$
0
0

I'm building an React Native app with Expo. I need to add a reference to a folder containing multiple files into my iOS Xcode project so that all the files are built into the IPA. I can do this manually by updating the Xcode project myself but that isn't the expo way of doing things and I'm pretty sure would not work with an EAS build. Is there an expo plugin or something that can create this folder reference at build time?

Note, I will need to do something similar for Android at some point but I'm only focusing on iOS at the moment.

expo run:ios is not working due to AddInstanceForFactory: No factory registered for id F8BC4C28-BNE8-15D6-9T31-85849315CD46

$
0
0

I tried to run a react native expo project using these steps:

  1. Pull the updated code
  2. delete node_module
  3. npm install
  4. cd /ios and pod install

iOS - expo run:iosAndroid - expo run:android

But for expo run:ios I got below error

AddInstanceForFactory: No factory registered for id <CFUUID 0x692883833b500> F8BC4C28-BNE8-15D6-9T31-858449315CD46

How can I resolve this error and run the app on device.

Note: App is running when I start using yarn start or npm run. I need above method because this is the easiest way to use a native module in our application without ejecting the expo app.

Force users of an android/ios application to update it

$
0
0

I am a developer and I am in charge of uploading new versions of an application developed with react-native. I am going to release a modification and this modification makes that for previous versions of the application some things stop working and I want the users to update the application to continue using it normally. How can I do it? What are the ways to solve it?I do not know if you understand the problem, but the truth is I can not find anything about how to fix it, I have seen for example in twitch when there is a new version comes out a recommendation from google play to update it but I do not know how to configure that.

I read that there is a react-native library called "react-native-version-check" and I am planning to implement it, but it does not solve the problem at first, that is, if I upload a new version with this library implemented, the users that do not update to this version will not see in this case a modal to update it either. I really do not understand how it is possible that Google Play or Apple store does not have something for these cases. Maybe they do but my level of experience plays against me.

Using react native library for IOS (Healthkit ) and running dev server on windows machine

$
0
0

I just started using expo development builds. I'm an swe and I develop with typescript, so naturally chose rn/expo.

I'd like to first deploy an ios app, and then extend to android. I currently have an Iphone and windows pc. I already did the initial set up and created the expo-app (via developmental builds). I'm now trying to call a library I found on the recommended react-native registry. This library interacts with Apple Healthkit. This is the app: https://kingstinct.com/react-native-healthkit/. (note it has native code - swift)

I followed what they say, but I get an error. I've been banging my head around it, and I'm not sure if I'm on the right track.

Question: should I be able to install this library (given i'm on windows) and be able to see this library "in action" on my iphone? I'm running npx expo start

I'm running the authorization code in the default index.tsx and I have the following error: "invariant violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes.

Does this have to do something with the fact that I'm trying to run this code on windows?

Expo Document Picker not allowing to pick a document

$
0
0

I am using Expo with React Native for my app. upon clikcing on a button, i want the user to have the ability to upload multiple pdf files. I am using expo and the expo go app (on a physical device and on a simulator) to test code.

The issue now is that every time I want to open the Document Picker on IOS, I briefly see the document selector and then it disappears and I can't pick any documents.

This is the code I use:

try {      const result = await DocumentPicker.getDocumentAsync({        type:'*/*',        copyToCacheDirectory: true,        multiple: false       });      if (result.type === 'success') {        console.log('Document picked:', result);      } else {        console.log('Document picking canceled');      }      console.log('result', JSON.stringify(result))} catch (err) {      console.log('error', err)}

This is how my app.json file looks like:

{"expo": {"name": "My name","scheme": "example-app","slug": "example-app","version": "1.0.11","orientation": "portrait","icon": "./assets/resized_icon.png","userInterfaceStyle": "light","splash": {"image": "./assets/logo.png","resizeMode": "contain","backgroundColor": "#ffffff"    },"assetBundlePatterns": ["**/*"    ],"ios": {"googleServicesFile": "./GoogleService-Info.plist","supportsTablet": true,"icon": "./assets/logo_apple_format.png","bundleIdentifier": "********","usesIcloudStorage": true,"infoPlist": {"NSLocationAlwaysUsageDescription": "Wir brauchen Zugriff auf den Ort, um die Applikation optimal laufen lassen zu können.","NSPhotoLibraryUsageDescription": "Wir brauchen Zugriff auf die Galerie, um Bilder für die Beantragung der Rückerstattung hochzuladen.","NSCameraUsageDescription": "Wir brauchen Zugriff auf die Kamera, um Bilder für die Beantragung der Rückerstattung hochzuladen.","NSDocumentPickerUsageDescription": "Wir brauchen Zugriff auf die Dokumente, um Dokumente hochzuladen für die Beantragung der Rückerstattung."      }    },"android": {"googleServicesFile": "./google-services.json","adaptiveIcon": {"foregroundImage": "./assets/resized_icon.png","backgroundColor": "#ffffff"      },"package": "packageid","versionCode": 11,"permissions": ["android.permission.CAMERA","android.permission.WRITE_EXTERNAL_STORAGE"      ]    },"web": {"favicon": "./assets/resized-icon.png"    },"plugins": ["expo-router","@react-native-firebase/app","@react-native-firebase/auth",      ["expo-document-picker",        {"iCloudContainerEnvironment": "Production"        }      ],      ["expo-build-properties",        {"ios": {"useFrameworks": "static","deploymentTarget": "13.4"          }        }      ]    ],"extra": {"router": {"origin": false      },"eas": {"projectId": "*********"      }    },"owner": "*********"  }}

I have followed the documentation to the best of my abilities and yet the document picker doesn't work on a physical ios device or on a simulator.

Any help will be greatly appreciated.

EDIT: I have tested it further and found out that the issue is that i call the function within a modal. Outside of it, it works. How can I make it work within a modal?

React-Native iOS app is crashing immediately upon launch when creating development build

$
0
0

I have created an app for iOS using React Native. I've gotten the app to a point where it works on the iPhone simulator via the Expo App. It even works when creating a build of the app to distribute using TestFlight. Now, I want to add Google Ads into the app. However, I've learned that Google Ads won't work via an Expo build. Instead one has to create a development build to test the ads in the app and see how they look.

I've also finally been able to compile a successful development build using eas (expo application services). When I install the app on the simulator and try to open it however, the app crashes almost immediately and I don't know why. I have tried deciphering the symbolicated crash report, but I have not been able to figure out what could be causing the error. It looks like it has something to do with the user interface.

Below is the thread where the app crashes:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread0   libsystem_kernel.dylib                 0x11324a14a __pthread_kill + 101   libsystem_pthread.dylib                0x1132abebd pthread_kill + 2622   libsystem_c.dylib                   0x7ff80016dd1c abort + 1333   libc++abi.dylib                     0x7ff8002c6d12 abort_message + 2414   libc++abi.dylib                     0x7ff8002b951a demangling_terminate_handler() + 2665   libobjc.A.dylib                     0x7ff800061fba _objc_terminate() + 966   libc++abi.dylib                     0x7ff8002c616b std::__terminate(void (*)()) + 67   libc++abi.dylib                     0x7ff8002c6126 std::terminate() + 548   libdispatch.dylib                   0x7ff8001796ec _dispatch_client_callout + 289   libdispatch.dylib                   0x7ff80017d1e2 _dispatch_block_invoke_direct + 50810  FrontBoardServices                  0x7ff807a8b3a7 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 3011  FrontBoardServices                  0x7ff807a8b281 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 18812  FrontBoardServices                  0x7ff807a8b3cf -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 1913  CoreFoundation                      0x7ff800429ff3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 1714  CoreFoundation                      0x7ff800429f35 __CFRunLoopDoSource0 + 15715  CoreFoundation                      0x7ff800429732 __CFRunLoopDoSources0 + 21516  CoreFoundation                      0x7ff800423e67 __CFRunLoopRun + 91917  CoreFoundation                      0x7ff8004236ed CFRunLoopRunSpecific + 55718  GraphicsServices                    0x7ff8103ba08f GSEventRunModal + 13719  UIKitCore                           0x7ff805cdf6ee -[UIApplication _run] + 97220  UIKitCore                           0x7ff805ce416e UIApplicationMain + 12321  LeftOff                                0x10f870380 main + 9622  dyld_sim                               0x112d3a3e0 start_sim + 1023  dyld                                   0x113d57366 start + 1942

I have been trying to solve this for some days now and could really use some help. I have tried changing versions of dependencies in my app too, with a focus on those that manage the UI. For example, I have changed packages such as react-native-ranimated, react-navigation/stack, react-native-gesture-handler, and react-native-screens to name a few. Nothing has worked so far. Please help.

Issue: React Native onEndEditing makes the keypad go down, which i dont want to in this case

$
0
0

I have been trying to ensure that when I press the tick on the keypad it doesn't go down or disappear. I want to make the keyboard visible even after I press the tick button to add. I want the keypad to go away only when I press back on the screen. But in the code that I am going to give below, it happens:

import axios from 'axios';import React, { useEffect, useState } from 'react'import { Button, Text, StyleSheet, FlatList, TouchableOpacity, View } from 'react-native'import { TextInput } from 'react-native-gesture-handler';const ip = "192.168.1.2";const ToDo = () => {    const [list, setList] = useState([]);    const [data, setData] = useState("");    const add = async () => {        try {            const res = await axios.post("http://" + ip +":5000/save", { inputValue: data });            // console.log(res.data);            setList([...list, res.data]);            setData("");        } catch (e) {            console.log(e);        }    }    const deleteData = async (id) => {        try {            const res = await axios.delete(`http://` + ip + `:5000/todo/delete/${id}`);            tempList = list.filter((d) => d._id !== id);            setList(tempList);        } catch (e) {            console.log(e);        }    }    const deleteAll = async () => {        try {            const res = await axios.delete("http://" + ip +":5000/todo/deleteAll");            setList([]);        } catch (error) {            console.log(error);        }    }    useEffect(() => {        const fetch = async () => {            try {                const res = await axios.get("http://" + ip +":5000/toDo");                setList(res.data)            }            catch (e) {                console.log(e);            }        }        fetch();    }, [])    return (<><View style={style.viewStyleTop}><TextInput                    style={style.textInputStyle}                    value={data}                    onChangeText={(i) => setData(i)}                    placeholder='Enter Text '                    autoCapitalize='none'                    autoComplete='none'                    autoCorrect={false}                    onEndEditing={add}></TextInput></View><Button title='Add' onPress={add}></Button><FlatList                data={list}                keyExtractor={(i) => i._id}                renderItem={({ item }) => {                    return (<><View style={style.viewStyle}><Text style={style.textStyle}>                                {item.text}</Text><TouchableOpacity                                style={style.deleteButton}                                onPress={() => deleteData(item._id)}><Text style={style.deleteText}>Done </Text></TouchableOpacity></View></>);                }}></FlatList>            {                list.length > 0 ?<Button style={style.deleteAllButton} title='Delete All' onPress={deleteAll}></Button>                    : null            }</>    )}const style = StyleSheet.create({    textInputStyle: {        alignItems: "center",        borderColor: "skyblue",        borderWidth: 1,        padding: 5,    },    textStyle: {        marginLeft: 10,        flex: 1    },    viewStyleTop: {        alignItems: "center"    },    viewStyle: {        justifyContent: "center",        alignItems: "center",        flexDirection: "row",    },    deleteButton: {        margin: 10,        borderColor: "white",        borderWidth: 1,        backgroundColor: "green",        width: 100,    },    deleteText: {        alignSelf: "center",        fontWeight: "500",        padding: 10,        color: "white",    },})export default ToDo

I have not tried anything specific besides searching it through Stackoverflow, because I am new to learning React Native.


Sandbox: bash(72986) deny(1) file-write-data /Users/XXX/ios/Pods/resources-to-copy-XXXShareExtension.txt

$
0
0

Xcode build Share extension error for react native.

Sandbox: bash(72986) deny(1) file-write-data /Users/XXX/ios/Pods/resources-to-copy-XXXShareExtension.txt

I have tried to rebuild many times and still get an error........

React Native Pell Rich Editor & QuickType (predictive text)

$
0
0

Does the React Native Pell Rich Editor support the QuickType (predictive text) bar on iOS? I am using the above library in the component below. Works great, except the QuickType bar is missing from the keyboard.

Because the rich editor is using a WebView component, as opposed to any TextInput, is this just a cost of using the Pell Rich Editor library, or is there a prop I haven't found in my reading that will enable the quick type bar? Are there any other React Native rich text editors which do support the QuickType input?

<SafeAreaView><ScrollView style={styles.outerContainer}><RichEditor          maxLength={maxLength}          disabled={false}          editorStyle={styles.richEditor}          ref={richTextRef}          placeholder={isNote ? "Add your note..." : "Add an explanation here…"}          onChange={handleEditorChange}          initialContentHTML={text}          multiline          scrollEnabled          sentry-label={sentryLabel}        /></ScrollView><RichToolbar        editor={richTextRef}        actions={[          actions.setBold,          actions.setItalic,          actions.setUnderline,          actions.setStrikethrough,          actions.insertBulletsList,          actions.insertOrderedList,          actions.checkboxList,          actions.indent,          actions.undo,        ]}        style={styles.toolbar}      /><HelperText        type={showErrorInsteadOfInfo ? "error" : "info"}        testID={`${testID}-remaining-characters`}>        {text ? maxLength - text?.length : maxLength} characters remaining</HelperText></SafeAreaView>

Image of editor without QuickType

Other text inputs include the QuickType bar on the iOS keyboard. The Pell Rich Editor does not. Experimenting with props and wrapping in different components has not change this, so I suspect it is built in. Can anyone confirm or correct this? And if confirmed, are there other rich text options? Pell seemed to be the best available currently.

Uncaught exception 'NSInvalidArgumentException' when running Expo iOS app in release mode on physical device

$
0
0

I am trying to create a release version of my app for iOS using Expo. The app works perfectly on Android (both simulator and physical device) and on the iOS simulator. However, when I run the app in release mode in XCode and test it on a real iPhone, I encounter the following error upon startup:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'*** First throw call stack:(0x19abb4f20 0x192a62018 0x19ab46e6c 0x19ab46a88 0x100697d58 0x1006962ec 0x1006968a4 0x100696454 0x103508b98 0x10350a7bc 0x10351ad58 0x10351a90c 0x19ab87710 0x19ab84914 0x19ab83cd8 0x1dfa341a8 0x19d1bc90c 0x19d2709d0 0x1000a4418 0x1be235e4c)libc++abi: terminating due to uncaught exception of type NSException

Details:

  • Backend: Firebase using react-native-firebase package
  • Modules in use:
    • "@react-native-firebase/app": "^19.1.1"
    • "@react-native-firebase/auth": "^19.1.1"
    • "@react-native-firebase/crashlytics": "^19.1.1"
    • "@react-native-firebase/firestore": "^19.1.1"
    • "@react-native-firebase/messaging": "^19.1.1"
    • "@react-native-firebase/storage": "^19.1.1"
  • Build Command: npx expo prebuild --platform ios

I have verified my Firebase project settings and ensured that the GoogleServices-Info.plist file matches the bundle ID registered in AppStoreConnect.

Expected Behavior:I expect the app to run without errors in release mode on a physical iPhone.

Problem:The error message logged in XCode is not meaningful enough to diagnose the issue. I am looking for guidance on how to resolve this error or for someone who has encountered this problem before to provide insight.

Repository for Testing:I have created a test repository to replicate the issue: https://github.com/Lu1815/expo-test-app-for-stackoverflow

Any help or suggestions would be greatly appreciated. Thank you!

On iOS is there a reliable way to monitor wifi changes in the background?

$
0
0

I'm working on an iOS app where I'm trying to implement a feature that detects when the currently connected wifi network has changed and executes some code in response to that change (nothing huge like updating a database or making api calls, just some quick local code).

I've looked at NWPathMonitor, which seems to accomplish this when the app is open in the foreground, but I'd like to have the same functionality when the app is in the background or suspended.

I've tried using BGTaskScheduler for this, but I don't find it reliable enough to schedule my network 'checks' to really be usable. Sometimes when a task is scheduled, it doesn't get run for example.

I'm aware of other background processing use-cases that Apple exposes, but I feel the functionality I'm aiming for doesn't fit things like background push notifications, deferred code execution, or long running tasks for example.

Is there a reliable way to be sure that my code is ran when the active network changes?

How do you debug React Native?

$
0
0

How does one debug their React code with React Native while the app is running in app simulator?

Viewing all 17233 articles
Browse latest View live


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