How to integrate native iOS framework in react-native plugin? - react-native

I have created react-native package successfully but unable to created plugin.
After creating react-native plugin I have integrated third party library in outer ios folder and push it to npm.
But when i'm using this plugin in other react-native project I got this error
"No such module 3rd Party Library"

Related

Integrate facebook sdk to track event in app

I have tried to integrate facebook analytics to my app which was generated by expo but got error
Undefined is not an object( evaluating AppEventsLogger.logEvent)
I have tried to use expo eject to use expokit and then add the following code
import {AppEventsLogger} from 'react-native-fbsdk';
AppEventsLogger.logEvent('battledAnOrc');
Is there anyone add facebook analytics to app which generated by expo before?
That's expected behaviour since react-native-fbsdk includes native code (Any library that includes a react-native link step in its installation instructions)
Currently, there are no built-in modules in Expo that have made that module available. It can be seen that we are working hard at the moment.
If you want to use a module, you need to make the app a stand-alone app.
You can run this expo eject and yarn add react-native-fbsdk and react-native link react-native-fbsdk

react-native link not linking my package in react-native project in android

I have made a custom wrapper in android for react-native. When I am using react-native link to install dependancy in android for my Project, it is not doing any changes neither showing any errors. I have followed this document https://www.botreetechnologies.com/blog/how-to-build-a-react-native-android-bridge for same but I have to make changes in android files manually for my Module and package. Do I need to add build.gradle too in android directory? or any other file if I have missed. This is my file structure for bridge.
This is how I am importing my local package in another React Native package's package.json

Uninstall expo sdk and setup firebase instead

We developed a React Native application with Expo Kit SDK. Now, We would change the native full Firebase SDK, but before we have to uninstall Expo SDK (Expo doesn't support external native sdk services). Is there a best practice to do that as easy as possible?
Hey I believe for Expo it's called detaching, like CRNA is ejecting...
https://docs.expo.io/versions/latest/expokit/detach
1. Install exp
If you don't have it, run npm install -g exp to get our command line library.
If you haven't used exp or XDE before, the first thing you'll need to do is log in with your Expo account using exp login.
2. Make sure you have the necessary keys in app.json
Detaching requires the same keys as building a standalone app. Follow these instructions before continuing to the next step.
3. Detach
From your project directory, run exp detach. This will download the required dependencies and build native projects under the ios and android directories.
4. Set up and Run your native project
Congrats, you now have a native project with ExpoKit! Follow the directions under Developing with ExpoKit to get things set up and running.
5. Make native changes
You can do whatever you want in the Xcode and Android Studio projects.
To add third-party native modules for React Native, non-Expo-specific instructions such as react-native link should be supported. Read more details about changing native dependencies in your ExpoKit project.

Native Module cannot be null - when integrating react-native project inside another react-native project

I have a react-native cross platform project based on Underdark library for exchanging data using Bluetooth and Wifi. this is working as react-native project. I am able to transfer data between iPhone and android.
Now i want to integrate this into another react native project as a package or use it in another project. But the private Underdark react native project is not a proper package in itself. It is just a working react native project.
I have integrated by using the following commands.
npm install —save
In Xcode I have imported the project and added the libraries/framework (underdark and protocol buffers ) into Build phases.
On the react side the entire project gets installed under node-modules.
Now i create a component and import the files in underdark library in node modules.
I run the react-native run-ios command to run it on my device.
It builds successfully but gives the following error.
2017-06-29 12:31:27.406 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2017-06-29 12:31:27.523 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
My question is
Is it possible to use a react native project in another project as a third party library. even if it is not a package.
How to remove this error.

Linking native library in react native?

1)What does it mean by saying native library? What sort of library ? are ones will be used as graddle dependencies ?
2)How to link these?
I was facing trouble while using link or rnpm.
Linking native library means that you are going to integrate already implemented module into your application or module which completes your react native's module functionality for eg: if you prepare a video player board with all the controls so in order to play the music you have to integrate react-native video (3rd party) because there is no inbuild lib. in react native. After integrating video lib you are good to go to play.
Steps to integrate lib(android):
1) Add package name to new packages()
2) Add dependencies to settings.gradle file and main application's gradle i.e app/gradle file.
3) sync the projects gradle because you made changes in the gradle and it's done.
After cloning/downloading the project:
1) Go to your project's home dir using cmd.
2) run npm install
3) Thereafter run rnpm link or react-native link
4) see ios folder in your project folder and if you find any pod file then run pod install after navigating into ios folder in cmd.
Cheers :)