How to set Constants.installationId for react native expo? - react-native

Iam new to react native and expo, while using an expo API in react-native project I got a warning "Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS
and localStorage on the web. This API will be removed in SDK 44."
And I got a solution for this from expo forum
But I can't figure out how to apply this solution to my project.

Related

Vote How to use react native firebase in Expo app

I have a React Native/Expo app where I am trying to use Firebase Cloud Messaging on an Android Device. I am stuck on implementing a successful Firebase Cloud Messaging initialization on Android.
I am completely stuck on this React Native Firebase error: you attempted to use a firebase module that's not installed on your Android project by calling "firebase.app()"

In Expo v35 managed workflow, how to handle `Warning: Async Storage has been extracted from react-native core`?

I use expo SDK v35, and works on the managed workflow (one without eject).
In my project, I face warning whenever I use AsyncStorage as demonstrated by their doc.
This, however, results in following warning being emitted:
Warning: Async Storage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '#react-native-community/async-storage' instead of 'react-native'. See https://github.com/react-native-community/react-native-async-storage
I tried to follow the instruction given by this warning, and tried to use #react-native-community/async-storage, but it did not succeed; it appears the library requires some linking, which is not available if you want to work inside the Expo's managed workflow.
Question
What is the proper way to handle AsyncStorage warning when working on expo's managed workflow?
Env
Expo 35.0.0
Recently I began developing a simple app using react native and the expo cli. However, on the react native docs, it seems that asyncStorage is getting deprecated. The solution would normally be to use the react community version but that is not compatible with expo.
https://github.com/react-native-community/async-storage/
There is currently no scope of linking libraries while using the managed workflow of expo. I've faced similiar issues , and was bound to migrate from expo to pure react native. And expo isnt meant for production as apps are slower. Better i would suggest you to migrate to pure React native . Async storage cant be used otherwise and if deprecated , you will be in a great problem in the future for your app.

Using native modules like Google Maps in a React Native app and Expo

Relatively new to React Native, I’m using AirBnb’s react native maps package in my app, and all the tutorials talk about getting Google Maps (rather than Apple Maps) to work in iOS by going into my iOS folder and managing the cocoapods dependencies etc.
I don’t completely remember, but I created my app with expo init, or maybe with create-react-native-app, and I don’t have an iOS folder. From what I’ve read it looks like I can get the separate folders by ejecting my app.
Here is what my actual question is about: The question is basically “Can I use Google Maps in an iOS MapView and still code my app in React Native and run it in Expo in both Xcode simulator and Android emulator, and still have hot/live loading?”
You could abstract the question just a bit and phrase it as “Can I follow the instructions on, say, a MapView tutorial, to use native dependencies, having iOS and Android folders, and still write my app in React Native and run it in both simulators with hot/live loading?”
(Or, once I’m using the native stuff do I have to code in Swift/Java and Xcode/Android Studio?)
As noted in the expo documentation, expo already contains a google maps map view.
https://docs.expo.io/versions/latest/sdk/map-view/
if you didn't create your app with expo but just with the create-react-native-app command you can use this package maintained by the RN community:
https://github.com/react-native-community/react-native-maps
This package uses native components so you need to link it (only if you don't use expo) and then you can just use it in your screens as a normal component.

Can I use Geolocation in a React Native unejected Expo Project?

The React Native docs give instructions on using Geolocation, but:
This section only applies to projects made with react-native init or
to those made with expo init or Create React Native App which have
since ejected.
Is it possible to use geolocation on projects that are still fully running in expo (without having been ejected?
Expo does provide api to get the current location. Please have a look over herelocation

React Native: How do you find PRODUCT_BUNDLE_IDENTIFIER using expo?

I am trying to implement Auth0 on my react native app and right off the bat you need to identify your PRODUCT_BUNDLE_IDENTIFIER for the callback the server uses through this template URL.
{PRODUCT_BUNDLE_IDENTIFIER}://{app_name}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
But since I'm using an Expo project I don't have the ios or android project folders. Am I missing something here or is it just impossible to configure an Auth0 with Expo created project?
The Auth0 React Native package uses native code; therefore, it's not compatible with Expo.
It looks like you may be able to work around this by using the web version instead, though. Expo has a repo (possibly out of date) which demonstrates this.