Exchange data between React Native Apps

Viewed 1658

I am currently developing two apps using React Native and App A stores user details like username,preferred language using Asyncstorage. Now i need to access these details when user opens App B i know we cannot achieve this through AsyncStorage as they are not shared across apps.But is there a way to do it.

This is what i need to achieve

2 Answers

Solution

  1. Use your server. It is the only simple way to share data with multiple applications in react-native.
  2. Handle more setting values for iOS and Android each.

Why?

Unfortunately, there is no way to get database from other applications in iOS. And query parameter would be ignored according to Apple Universal Link Documentation.

Note that only the path component of the URL is used for comparison. Other components, such as the query string or fragment identifier, are ignored.

Thus, if you want to give your database information to another application without network, you need to handle more setting value for sharing contents with other applications in iOS and Android each. and split code. And you may use native code.

You can use react-native-send-intent

npm i react-native-send-intent


SendIntentAndroid.isAppInstalled("com.facturationandroid").then(isInstalled => {
    SendIntentAndroid.openApp('com.facturationandroid', 
     {"data1": "hello", "data2": "test"}).then((wasOpened) => {});
  });

Check the documentation for more information

Related