Posts

Showing posts with the label ios

SwiftUI NavigationLink for iOS 14.5 not working

14 3 I had the following code in Xcode 12.4 that worked perfectly ScrollView(.horizontal, showsIndicators: false) { LazyHGrid(rows: rows, spacing: 0) { HStack { if (type == "Quiz") { NavigationLink(destination: Quiz(id: quiz.id)) { VStack(alignment: .leading) { Text("Quiz") .font(.headline) .foregroundColor(.white) .padding(.top, 8) .padding(.leading) } .background(Color.g...

React Native / iOS SDK. No matching function for call to 'RCTBridgeModuleNameForClass' after update iOS SDK to 14.5

11 4 I have updated the iOS SDK platform to version 14.5 . The xCode version is now 12.5 . After updating, I cannot launch the application on my device. An error: No matching function for call to 'RCTBridgeModuleNameForClass' . I tried reinstalling the pods but it didn't help. How can fix it? Thanks ios xcode react-native sdk Share Improve this question Follow ...

How to migrate to Xcode 12.5

7 2 I'm not able to build a React Native project, which built correctly using Xcode 11, using Xcode 12.5. I can no longer use Xcode 11 because only more current versions of Xcode carry the necessary API to publish/upload to TestFlight and the app store. Now I get three build errors: Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *' Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *' Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *' I also noticed that deployment targets were a...

React Native 0.64 won't build iOS app after updating Xcode to 12.5 and iOS to 14.5

11 2 After upgrading Xcode to 12.5 and iOS to 14.5, I can't run the iOS app on a real device nor in the simulator. After running npm run ios , I get this message: The following build commands failed: CompileC .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/guilherme/Documents/Dood/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler If I try to run the app on a real device using Xcode, this is the error I get (related to Flipper-Folly): .../ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable Id...

implementing react-native-fbsdkshare

I have followed the guide written on https://github.com/facebook/react-native-fbsdk to install and use the react-native-fbsdk module. However, when I click the "Share" button it throws the following error: 'Error: undefined is not an object (evaluating \'FBSDKShareDialogInterface.show\') Also 3 warnings appear when I run the app: 'Warning: Native component for "RCTFBSDKShareButton" does not exist' 'Warning: Native component for "RCTFBSDKSendButton" does not exist' 'Warning: Native component for "RCTFBSDKLikeControl" does not exist' This is the code that I use: var FBSDKShare = require('react-native-fbsdkshare'); var { FBSDKShareDialog, FBSDKShareDialogInterface, FBSDKShareLinkContent, FBSDKShareShareButton } = FBSDKShare; shareOnFacebook() { var linkContent = new FBSDKShareLinkContent('https://facebook.com', 'Wow, check out this great site!', ...

React native map integration

I am trying to integrate map in react native. I am following the below tutorial. https://github.com/airbnb/react-native-maps I gone through all the installation instruction. I am using react-native version : 0.44.0 and react-native-map version : 0.13.0 I made sure that react-native-link is linked with android and iOS. While rendering the mapview in ios simulator, map is not showing and only i am able to a blank map with red outline. Please check my below code and let me know, where i am wrong. var MapView = require('react-native-maps'); <MapView initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0922, longitudeDelta: 0.0421, }} /> Try adding a View and some heights and ...StyleSheet.absoluteFillObject <View style={{height:400}}> <MapView style={{ ...StyleSheet.absoluteFillObject,height:400 }} initialRegion={{ latitude: 37.78825, longitude: -...

Fresh react-native ios app not building?

Below is the details about my environment and logs of the build failure. Anyone facing similar issue or know steps to overcome this please do point me out to relevant steps or docs. Xcode: 7.2.1 Node: v5.9.0 npm: 3.7.3 react-native-cli: 0.1.10 react-native: 0.22.2 Running "sudo react-native run-ios" leaves me with the below logs. LOGS: ** BUILD FAILED ** The following build commands failed: PhaseScriptExecution Run\ Script /Users/abc/Desktop/REACT-NATIVE/demo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh (1 failure) Installing build/Build/Products/Debug-iphonesimulator/demo.app No devices are booted. Print: Entry, ":CFBundleIdentifier", Does Not Exist /Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/done.js:10 throw err; ^ Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/demo.app/Info....

Native View Presenting a React Native View

Does anyone know how I can have a native UIViewController present or push a React Native view, and go back and forth between the two? If possible, I'd like to load the React Native view inside a UIViewController so I can retain my navigation bar, but use the React Native view. I've been reading the documentation, but I have not been able to find anything that works. I've tried a combination of this: // RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:nil launchOptions:nil]; // RCTRootView *reactView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"My Test" initialProperties:nil]; NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; RCTRootView *reactView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"My Test" ...

React Native Linking Library

I wanted to use the Native IOS search bar from https://github.com/umhan35/react-native-search-bar and when I run npm install --save (http://facebook.github.io/react-native/docs/linking-libraries-ios.html) I get error bash: library-with-native-dependencies: No such file or directory. I tried to link the library manually but it fails without showing any error. Can some one help? I hope you did not type npm install <library-with-native-dependencies> --save -bash: library-with-native-dependencies: No such file or directory In case you did, it should have been npm install react-native-search-bar --save If you managed to link it manually and run it, try setting a width and height for the SearchBar ......... render(){ return (<SearchBar style={styles.searchBar} ref='searchBar' placeholder='Search'/>); } ......... const styles = StyleSheet.create({ searchBar:{ width: 200, height: 40 } }); Check whether module pres...

Open native camera from react native

I am new to react native and need your help. I am new to react native I am trying to integrate blink sdk with my react native app. I have exposed a native method to react native js using RCT_EXPORT_METHOD() . JS button click is invoking this native method. Now from this native method I want to open camera using: /* Allocate and present the scanning view controller */ UIViewController<PPScanningViewController>* scanningViewController = [coordinator cameraViewControllerWithDelegate:self]; scanningViewController.autorotate = YES; scanningViewController.supportedOrientations = UIInterfaceOrientationMaskAll; Now there are two problems: If I run it just like that, it gives me red screen saying "invoke the method on main thread". Now to run it on main thread, I added -(dispatch_queue_t)methodQueue { return dispatch_get_main_queue(); } Still it is not running and saying not present in view hierarchy. Please help.

React Native Push Notication - react-native-fcm - ios cannot build

Hello, I'm trying to use push notification in react native and for that, I am using react-native-fcm. It is working on Android and it allows the receiving of notifications from firebase. However, on IOS, I get build errors as shown in the attached photo. I did react-native link, made sure the lib was in build phases for linked binaries and also modified the AppDelegate as mentioned in the installation steps. Has anyone encountered the below error? I did a project clean, delete the build folder but to no avail. Install pods for FCM... https://medium.com/google-cloud/push-notification-for-react-native-bef05ea4d1d0 Please check So, after much struggling... The issue was not with IOS or the react-native-fcm module. It was with an outdated pod repository. After updating the pod repo, "pod update Firebase/Core", all the errors disappeared.

React Native production build

React Native documentation tells you to change source code manually to switch between development and production builds. https://facebook.github.io/react-native/docs/running-on-device.html#building-your-app-for-production Is this the only option? Why isn't there a way that allows you to flag this and generate a production build using the same source code?

How to run React-Native Examples?

I can't find any instructions on how to install and run one of the other Examples provided in 'https://github.com/facebook/react-native/tree/master/Examples' such as 'https://github.com/facebook/react-native/tree/master/Examples/Movies'. The tutorial only tells you to do react-native init AwesomeProject which grabs 'https://github.com/facebook/react-native/tree/master/Examples/SampleApp'. If I clone the entire 'react-native' repository, and then run npm install npm start From the root folder (i.e. '/react-native'), and then open '/react-native/Examples/Movies/Movies.xcodeproj' in Xcode, and Run the project, it seems to build fine. The Simulator comes up, shows a "Movies" intro screen for the app, but then the red screen of death appears with a print out of: :0 and Terminal, where 'npm start' is running at the root folder, prints out: Error: EISDIR, read at Error (native) [02:35:02] <STA...

Export data from React Native to Native

I have a number of components that are being integrated into Android and iOS apps, and would like to have some metadata that lives alongside the React Native code that gives the apps some information about the components before they are mounted/loaded . The native React Native framework allows one to inject constants and functions through "native modules," which can be accessed globally without being tied to a component, activity, view controller, etc. Basically, we can easily send data Native => React Native. Is there a simple way to do the same thing from React Native => Native, like exposing a constant or a function which can be accessed through the React bridge/context by the native app? I needed to pass some data from React Native to Native(iOS) for that I have used Notifications. May be this can help some one. Import NativeModules in your React Native file import { StyleSheet, AppRegistry, Text, TextInput, View, NavigatorIOS, Butt...

Storage in React Native

I'm about to develop offline dictionary app with React Native. But I'm not sure which storage is the best in React Native between SQLite & AsyncStorage . As I read some online documentation and tutorials, when I use SQLite I must need to configure SQLite library in each app iOS and android . And when I look through AsyncStorage not sure it can be handle or not million records inside it. That's why I like to know which one should I use between SQLite & AsyncStorage or some cool library out there for React Native? For that case, I recommend using Realm. It is simply much faster than AsyncStorage and SQLite. Read this and this for more info. AsyncStorage has slow runtime and has no indexing capabilities. It accepts only strings as its value and you need to serialize data before inserting and deserialize when reading. So it's not good for large amount of data. It also has 6MB limitation for Android devices.

Apple Pay with React Native

We are trying to add an Apple Pay button to our React Native App. Is it possible to create your own apple pay button in react native, or is it required you use some sort of API / kit / asset? Yes you can create your own apple pay button. You just have to make sure to use their asset for the apple icon and follow their strict style guidelines. You can find a lot of documentation here: https://www.apple.com/apple-pay/ and you can download the necessary asset here: https://images.apple.com/apple-pay/downloads/Apple_Pay_Payment_Mark.zip

React Native Run Android

Facing the issue with react native run-android. I'm unable to start react app Loading dependency graph, done. error: bundling failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In E:\react\udemy2\node_modules\babel-preset-expo\index.js at createDescriptor (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:162:11) at items.map (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:87:50) at Array.map (<anonymous>) at createDescriptors (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:87:29) at createPresetDescriptors (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:79:10) at presets (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:61:19) at presets (E:\react\udemy2\node_modules\@babel\core\lib\config\config-descriptors.js:51:25) at mergeChainOpts (E:\react\udemy2\node_modules\@babel\cor...

React Native “imports”

I am trying to develop a react-native book-searching app and have found this online as a helper tool: https://www.appcoda.com/react-native-introduction/ However, the site is from 2015, so some of the syntax is not properly updated. I've run into the following issue: The code that they tell me to use is as follows: 'use strict'; var React = require('react-native'); var Books = require('./Books'); var Search = require('./Search'); var { AppRegistry, TabBarIOS, Component } = React; When I used that, I arrived at an Error Message telling me to use import React, { Component } from 'react'; instead of import React from 'react-native'; In my attempt to update it to the latest version of React, I arrived at: 'use strict'; import React, { Component } from 'react'; var Books = require('./Books'); var Search = require('./Search'); var { AppRegistry, TabBarIO...

React Native Config.h not found

I'm beginner of React native developer. After create new project then open it. xcode is display error config.h file not found in mutex.h file. I'm also search in google and try possible solution but still display same error. I'm done Following Commands 1 enter code hereenter code hereenter code here /usr/bin/ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"` 2 brew install watchman 3 npm install -g react-native-cli 4 react-native init projectName 5 cd projectName react-native start 6 react-native run-ios Error in CMD ./Desktop/Demo React Native/projectName/node_modules/react-native/React/../third-party/glog-0.3.4/src/base/mutex.h:105:10: fatal error: 'config.h' file not found include "config.h" // to figure out pthreads support 1 error generated. Software Version List Homebrew 1.6.8 react-native-cli: 2.0.1 react-native: 0.55 watchman 4....

react-native-admob compatibility with wix react-native-navigation

I'm using wix/react-native-navigation router (tab based app) and react-native-adbmob package for AdMob Rewarded Video Ads. On Android, it works well, but on the iOS, when I try to show a Reward ad in react-native-navigation Modal window ( this.props.navigator.showModal(config) ), it is not visible although the adOpened event is fired. Has anybody faced the same or similar issue with other packages?