Pass data between react-native and android - react-native

I need to pass data from react-native to android.
Within react-native, once the user is logged in, I need to get the user ID and store it in memory.
Next time when the app starts, I need to access that user ID from android code and supply it for an sdk for some data processing. I tried https://www.npmjs.com/package/react-native-default-preference but couldn't get the value added from react-native from android side.
And when I was trying to configure react-native default preferences I got the above error image

Try to delete new RNDefaultPreferencePackage() from returned package array from MainApplication.java in getPackages method
should be something like this

Related

Get Google Click ID (gclid and msclkid) inside React Native

Inside the web today, we are getting gclid and msclkid when user get's on the lending page from the google ad, with
const { gclid, msclkid } = queryString.parse(location.search);
And we are storing it inside the DB,
Now we want to do the same inside our mobile app too, when user intall the app from the ad we want to get those 2 values and store them inside DB
We are using Expo EAS inside the mobile project righ now, but I'm not that experianced with this marketign tools
Anyone know how this can be done?
Thanks!
I've tried getting it inside the product thru firebase analytics but it seems it's not working or I'm doing it wrong, I also tried this lib https://www.npmjs.com/package/react-native-advertising-id but it's outdated and it does not seem to pull data I need

how to pass member id from api from one screen to another in react-native

react-native
I am Stuck can anyone tell me how to pass member id from API from one screen to another in react-native I have tried certain methods but I am not getting proper solution
You can use react-native-mmkv or React Native Async Storage to save your id in memory and load it.

How to call react-native function from IOS native module(Plugins)

I want to call react-native function from native module.
I have created one barcode-scanner plugins for my react-native app, barcode-scanner SDK is available in native IOS & Android so, i extract those native code and create one plugins(NPM) for react-native app.
Now my problems is, Once barcode-scanner scan a data and send to native IOS, how can i get those scanning data in my react-native app ?(I got scanned data in IOS native)
I want to call react-native app function once native module scanned a data and send those data in react-native
Please give example or proper document so i can try and implement.
Thanks in advance.
You'll find your answer well described here:
https://facebook.github.io/react-native/docs/communication-ios#passing-properties-from-native-to-react-native
I have used "RCTDeviceEventEmitter" & "NativeEventEmitter" and add listener for received event
more detail

How to get uuid of mobile (iOS & android) permanently in react native

I'm working react native project.
I'd like to know how to get uuid of mobile and keep it on firestore.
I've tried to do it using anonymous uuid in firestore. However, this one wasn't solution cause if an user remove an app and re-install the app, then uuid is changed.
So, I need to keep immutable uuid.
If you have any of idea, please let me know.
Thanks!
I think that keeping the UUID the same after the user has removed the app and reinstalled is impossible. From ios docs: "The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. ", and from Android docs: "The value may change if a factory reset is performed on the device or if an APK signing key changes".

codepush react native new package

I tried react native code push and it works flawlessly. Let's say I modify the text in my buttons to say something else, then with a single command, the update is sent to the users.
Now, lets say I am using a new npm library which requires some native code. Say react-native-image-picker (https://github.com/react-community/react-native-image-picker). Can code push handles this? I want the image picker functionality to be updated too in my users app. Thank you.
No - CodePush can only update JavaScript code and images.
CodePush does not update native code at all so any changes to native code require a full app build and deploy via the relevant app store or app distribution tool (e.g. HockeyApp).
Note: There are some limitations around images - full details here.