How to integrate FCM (firebase cloud messaging) with react-native - react-native

I am working on a react-native app and I am required to integrate FCM push notification service, so how can I integrate it?

Use this module
https://github.com/evollu/react-native-fcm
Install
npm i -S react-native-fcm
Link the library to your iOS/Android project
react-native link react-native-fcm
Check the configuration and usage details in the README

I came across the same issue and I find out there were 2 ways
react-native-fcm: Simple and Easy to use.
Create my own module! why reinvent the wheel right? but react-native-fcm has 79+ open issues and hasn't been updated since past 1-month while Firebase is changing very rapidly.
So decide to create my own module and handle it my own way.If you are planning to make your own module then I have shared my code on this Git Repo: https://github.com/hiteshsahu/react-native-fcm-android.
Hope it helps.

Related

How to publish expo app that can be accessed by anyone, anywhere using QR code?

after completing the development of an expo app, I want to share it with friends who can check it by QR code or link to a live server. How can I do it?
If you are using the Expo Managed workflow, you can share your application with Expo Go. In this case, you don't need to publish in any store. Just follow the instructions to share pre-release versions by Expo Go on documentation. I created an Expo project to publish and share with a link that contains the QR code to run on Expo Go.
Note: To see the Expo application install Expo Go is required.

How to connect to an SSID from an app built with Expo and React Native?

I want my app to be able to connect to a Wifi network whose SSID and password are already gonna be hardcoded in the app. Hope there is a way to do this in expo. I know I could use something like https://www.npmjs.com/package/react-native-wifi-reborn but probably do not want to eject out of expo.
Answering my own question here for anyone who's facing the same problem.
With the latest Expo updates now we can add react-native packages to the managed expo workflow without ever ejecting. What that means is we can install https://www.npmjs.com/package/react-native-wifi-reborn to our Expo project.
We'll just be needing to install expo-dev-client to our project and then use EAS build. Consider reading this guide to follow the exact steps needed https://docs.expo.dev/development/getting-started/
Here is a little blog post I wrote discussing about the same.
https://blog.chiragsrvstv.dev/install-native-modules-with-expo

How to run a react native app (a bare workflow from expo or a regular one) in web (browser)?

I'm trying to run my React Native app as a web site, on a browser.
I tried to go according to https://necolas.github.io/react-native-web/docs/installation/ but the instructions on the Setup page are not clear.
I found some (rare) posts regarding this, but they are old (2019) and seem to deviate from the info in the link above.
I use yarn android to run it on android.
So, I tried using yarn web. Didn't work.
Also, tried the basic react-native start followed by react-native run-web.
It seems the run-web command is not what is needed.
Any assist appreciated.
P.S. I initialized my project through Expo, as a Bare Workflow project. Hope that helps
According to the docs:
Expo for web can work on any React Native project. When you initialize a new project with a bare workflow template using expo-cli, if you run yarn web or npm run web it will start up expo-cli and open your project in a web browser.
The same guides for web from the managed workflow apply here.
So basically just initialise your project using expo init project-name and then select bare workflow or managed workflow. After that you can execute npm run web. It will open up the browser and run the web version of it. Keep in mind that there are some incompatibility of libraries from expo, for example, the Webview is incompatible on the web so you need to switch when on web to an iframe or so.

Push-Notification in react-native

Is it necessary to do manual installation for react-native-push-notification as mentioned in library npm page. I did it but its not working. Can some share the latest example for the same.
Is there any alternative to react-native-push-notification.
You can user react-native-firebase npm package, it is a well documented library for push notifications and cloud messaging.

using fabric beta testing with react-native expo project

Is there a way I can use Fabric beta testing with react-native expo project ?
I searched all over the internet but didn't find an example of this.
Edit 1: The project has been already created using CRNA command.
PS: I know I can detach from expo then build each project with fabric separately, but detaching process is tedious.
You need to detach your app, once detached you can follow the crashlytics iOS guide with Objective-C, with a difference in the API key step, use the Info.list file inside the Supporting group, just make sure to delete the old Fabric keys already added inside that file.
After that you can use the beta like a normal iOS app, hope this helps you