How to set Facebook events in Expo SDK 47? - react-native

I upgrade my expo project from SDK 45 to SDK 47, then I found Facebook.logEventAsync is not working.
import * as Facebook from "expo-facebook";
Facebook.logEventAsync("event 1");
I check the website https://github.com/expo/expo-facebook.
They say This module is removed from Expo SDK in SDK 46 and recommend to use react-native-fbsdk-next
When I try to install the package
yarn add react-native-fbsdk-next
just paste the code
import { AppEventsLogger } from "react-native-fbsdk-next";
run the project on iOS will show the error:
Invariant Violation: Your JavaScript code tried to access a native module that doesn't exist.
I think it is because there is no npx expo install react-native-fbsdk-next. I just use yarn add can't link to native android and iOS on Expo project.
So If I want to use Facebook event on Expo SDK 47. Is there any package can do this ?

Related

How to change Android SDK (AVD) path in expo-cli for React Native?

I've recently started learning React Native. My Android SDK is located in this path - D:\Apps\Android SDK\platform-tools but expo-cli thinks it is in the default directory and throws me errors. Is there a way I change the path that expo checks for Android SDK?
I expect that expo cli checks for the Android SDK in this path D:\Apps\Android SDK\platform-tools

Why expo is showing Loading DevTools Error

My react native app is showing error when using expo-cli:
Error loading DevTools
,No scheme specified for development client
picture:
I am using expo version 44 And react-native version 0.64 ,also I have used expo init in order to create my project.
How can I fix this error?
You'll have to run:
expo install expo-dev-client
Then, for Android:
expo run:android
or for IOS:
expo run:ios
Since config plugins will let you customize your project from JavaScript without ever needing to directly modify XCode or Android Studio projects.
More details here
https://docs.expo.dev/development/getting-started/

Sendbird SDK requires fs package in react native

When I install the sendbird SDK into a expo managed react native project I get the following error:
The package at "node_modules/sendbird/SendBird.min.js" attempted to import the Node standard library module "fs". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo
However fs is a node package which isn't the environment run by react native. I've looked through the Sendbird examples, and have used this very same SDK in other apps. What am I doing wrong with this one?
SendBird here! Our apologies, but there is a known issue in JavaScript version 3.0.119 that is causing it. This will be fixed in the next version, coming very soon! In the meantime, please build with version 3.0.118 as needed.
If you are using npm, you can run this command:
npm install --save sendbird#3.0.118

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

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.