React Native: How to install 3rd Party Native Module Plugin on Post-Integration .xworkspace Project - ios

I've successfully integrated a very basic React Native Project(without any Native Module Plugin) with the existing iOS Native App(Written in Objective-C) on which presentViewController and dismissViewController are both implemented successfully.
However I cannot find any post and official documentation to show how to install those third-party react-native native modules, such as react-native-deivce-info, react-native-camera etc., into the post-integration .xworkspace project. Can anybody show me the steps? For example, the "react-native-video". Thank you so much.

Related

How to install React Native dependencies inside the iOS project?

I have integrated React Native into an already existing iOS app, and everything is working as expected: connecting to the Metro server or to the local main.jsbundle file.
We have used Git submodules to contain the iOS and Android apps (sub-repositories) inside the React Native app (main repository). So Android and iOS teams can work separately in our own branches.
But we would also like when somebody clones the iOS repo standalone to be able to run the app without having to download the parent React Native repository.
Currently, this is not possible (even though we are not connecting to the Metro server but to the main.jsbundle file that is included in the iOS repo) for the following reason.
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
The Podfile accesses the parent folder (React Native repo), where the React Native libraries are located. Instead of obtaining them from the iOS project itself. This makes CocoaPods installation impossible outside the React Native app context/repo.
Is there a way to install React Native libraries and dependencies inside the iOS project without forcing CocoaPods to look for them outside?

Module RCTLog is not a registered callable module, Module AppRegistry is not a registered callable module, Module RCTDeviceEventEmitter is not

I followed this tutorial to create my react native library with Native Module. I need to use a mobile SDK developed from BROTHER to use their printers in one of my REACT-NATIVE app.
The library that I wrote works great, and I'm able also to test in the example app that the automatic tool creates.
Now I want to use this library in my REACT-NATIVE app, and I followed these steps:
in the path of my react native app i wrote npm install ;
in my app I call my library with import MyLibrary from '...name of my library...' without using it inside my component, just import only to try if there is some error;
The result is that my app start and is blocked with white screen and in the log of XCode I receive the following errors that are in loop:
and
I tried to delete metro cache, remove node_modules, reinstall pods...nothing helped me.
If I remove the line import MyLibrary from '...name of my library...' my app works.
There is some problem in the way I have to link my local library to my react-native app.
I started my react-native app with EXPO and after I ejected it.
react: 16.13.1
react-native: 0.63.4
npm: 7.9.0
To solve this I should only create a Swift file and a Bridge header file in the React app where I want to add my Native Module. This is because I developed the Native Module with Swift.

Upgrading React Native plugin to support autolinking and React Native versions 0.6>=

I am fairly new to React Native but am helping manage a React Native plugin and would like some guidance for upgrading it so that it is compatible with auto linking and React Native versions 0.60 and up in iOS.
Our plugin currently only works with React Native up to and including 0.59.x through the react-native link command and sometimes involves manually dragging our xcodeproj and .a binary inside Xcode.
When trying to instrument our plugin with a blank hello world React Native app of version 0.60.5, after react-native link and dragging in Xcode, we get an error saying rctbridgemodule.h not found and have to add React.xcodeproj too. This however doesn’t work on some apps we’ve tried. Furthermore the issue is in newer versions of React eg 0.61.4, the React.xcodeproj file is no longer in the React folder in node_modules. 

I’ve had a look at the What do I need to have in my package to make it work? Section in this link: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
But to me its not very clear how we should be configuring a pod spec in the root of our repo. Our package is scoped also. I’m assuming that there shouldn’t need to be any changes to the actual code of our plugin but rather just some modifications to our pod spec and package configuration. Any guidance in how this works and how to upgrade our plugin to support versions 0.6 and above would be greatly appreciated. Thanks!

Error during compiling of a custom module for react native in swift

I am trying to develop a module for react native in swift, I have followed the tutorial of Facebook documentation:
All work correctly, but if I put it on GitHub and I try to install it in other react native project, when I compile it, I get the follow error:
"Swift is not supported for static libraries"
Here is the code of my react-native module.
How can I compile my react native app using a react module written in swift?

Having issues with an iOS react native native module using a CocoaPod

I'm creating a native module wrapper for the Google Nearby Messsages API.
I've installed the api using these instructions https://developers.google.com/nearby/messages/ios/get-started
I then published the project to npm and created an example project to consume react-native-nearby.
I've been stuck with this issue.
I ran yarn to install react-native-nearby and react-native link react-native-nearby. Yet it can't find GNSMessages.h which should have been installed using cocoapods? Would be happy to get a lead as to why it can't find that file.

Resources