I am using the latest version of react native 0.60
When I add the react-native-fbsdk module
The document does not seem to apply
Does anyone know how to add the react-native-fbsdk module in react native 0.60?
Platform: Android
There's not much to do, really. You simply need to skip the Link section of the instructions, as stated in the installation guide and then configure both projects with your Facebook App Id.
Related
I'm trying to use Geolocation on my React Native app (Ios, expo). I have installed react-native-community/geolocation, and when I import it I get this erro:
#react-native-community/geolocation:NativeModule.RNCGeolocation is null.
It asks me to run "react-native link #react-native-community/geolocation" in the project root, but when I do it it says: Calling react-native link [packageName] is deprecated in favor of autolinking.
I do not know what to do anymore. Can anyone help me with this? Please
If you are using Expo, you can use the Location from Expo.
But if you want to use the #react-native-community/geolocation, since react-native 0.60 or higher the autolinking should configure the library for you automatically. But if use react-native 0.59 or lower, you must make a manual installation for iOS and Android when the react-native link doesn't work.
I am trying to build simple app to creative native library and link with react native app.
I am facing issue like
Error : Unable to resolve module react-native-fingerprint from App.js: react-native-fingerprint could not be found within the project.
Note : 'react-native-fingerprint' which is been created and want to link with app.
I guess you're using react-native-fingerprint-scanner. Since library you mentioned doesn't exist.
In case if you using this library react-native-fingerprint-scanner.
Installation
npm install react-native-fingerprint-scanner --save
or
yarn add react-native-fingerprint-scanner
Link to Native Platforms
react-native link react-native-fingerprint-scanner
Even after this it is not working. Following this guide
React camera requires us to do linking, which with react native says we must cd into the ios folder and run pod install but we dont have the ios folder without ejecting the app, so why won’t the previous method using ‘react-native link react-native-camera’ work? Is there a way to make it work?
if you are using expo , then i would suggest to use expo-camera as react-native-camera wont work coz it requires linking and expo projects doesnt provide linking.
expo-camera
And if you are using bare react native project , then yes you have to link react-native-camera if you are using RN versions <0.60 , and if higher , it will be automatically be linked.
hope it helps. feel free for doubts
please follow this step which available in below link and i m sure it's working:->
https://react-native-community.github.io/react-native-camera/docs/installation
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
I understand that react-native link (see post) is an automatic way to install native dependencies. The post above explain how to use the link command but lacking the detail of when to use it. Should it be used after adding a component, every code change or after introducing new module to the app?
Why we use react-native-link??
In this post, I will explain why we use react native link command and when we need to use this command or not?
First, we will understand what is native module??
Native Modules
Native modules are usually distributed as npm packages, apart from the typical javascript files and resources they will contain an Android and ios library project.
React Native provides an impressive amount of native modules that give you direct access to core platform APIs on both Android and IOS.
For example react-native-maps, react-native-firebase, react-native-socketio etc.
These modules or packages contained both platform (Android and Ios) code.
Now coming on to the react native link
Those libraries which are use native code, in that case you'll have to add these files to your app. For linking those library with react native code need to run react-native-link
Here are the few steps to link your libraries that contain native code
Automatic linking
Step 1
Install a library with native dependencies:
$ npm install --save
Step 2
Link your native dependencies:
$ react-native link
Done! All libraries with native dependencies should be successfully linked to your iOS/Android project.
Where we don't use react-native-link??
Those components which are only written in javascript they are not using any native code (Android and Ios). There is no need to run react-native-link.
For example rn-modal-picker, react-native-check-box etc.
You should check out this other answer: The use of react-native-link command?
You only need to run react-native link NAME_OF_PACKAGE when you install a new package that has a native codebase, or without arguments if you want to do it for multiple of them.