Garmaine Staff asked 2 years ago

How to access persisted Redux store in React Native Java (Native Android) section of project?

I have Android Foreground Service running and I am sending Location data to my API every 5 minutes. My Service calling HeadlessJS Method what then ramp up Redux store, fetches API_TOKEn (JWT) and then make HTTP request to endpoint.

I want to simplify this by removing HeadlessJS part: I want to call HTTP request directly from Java Service, but I need to fetch ACCESS_TOKEN somehow from persisted store. I am using Redux-persist and saving state into AsyncStorage.

So how to access my state (store) from Java Project? (/android/app)?