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

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.

Related

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!

React-native custom native module couldn't search header search path

I am building a wrapper SDK in react-native. However, I am new to react-native and facing following issues:
I have created a library using react-native-create-library npm package. While compiling iOS module it gives error that React-native bridge is not found.
I ignored the issue and integrated my code. When I link the SDK in a client app (created using react-native init), the SDK doesnt give the error for react-native bridge.
The existing iOS SDK is integrated via cocoapods in client app and I am trying to link it in the wrapper SDK via header search path. But whatever I try, I keep getting an error that the "module not found".
I am using Xcode 10 and Swift 5.
When I run pod install, the existing iOS SDK copies the files in Pods folder. I thought it should copy the framework file so that header search path could look up the headers in it. I have provided ${SRC_ROOT}/../../../ios/Pods as recursive in wrapper SDK's header search path. But it didn't work.
Can somebody please help me with the issues? I have googled for sample codes and suggestions but none of them worked.

React Native project version upgrade error: v0.56 to v0.60, iOS fails

I'm currently upgrading one of my projects built in React Native v0.56 to latest v0.60. Created a new project with version v0.60 and updated all the packages used in previous version of app, but now facing weird errors.
I've already tried all the possible solutions mentioned in Git and Stack overflow. None of them worked for me. I've also tried to remove plugins one by one and then adding them but not able to find cause of the error.
iOS:
In iOS, all the packages by default autolinks as per v0.60, but I got error of linking in very first package, I've tried manual linking too, not working.
After manual linking do cd ios and then pod install. This will not be done by autolinking and you have to do it yourself. On iOS on my project i had to manual link on iOS almost every library and almost all of them needed a pod install
use upgrade helper from react native community Upgrade Helper

How to get `react-native link` to link my library via Cocoapods?

I am writing a new library for React Native that uses native components for iOS and Android. It depends on another native library via Cocoapods, and contains a .podspec file. When I try to link it to a test project using react-native link, it successfully adds the source project as a library, but doesn't install the dependency via Cocoapods.
It looks like there are ways to customize the link behavior via rnpm keys in the package.json file, but I can't find any info on what those should be (it's also unclear if those are used by the newer link command, or are a holdover from the actual rnpm days.) If there are docs on that that you know of, please pass them along!
Otherwise, my main question is this: how can I get react-native link to install my dependency via Cocoapods, or do I need to reinvent that wheel?
Thanks in advance!

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

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.

Resources