You will need to add some native code to your project. I don't have experience doing this for iOS, but here's an outline for how to do it on Android.
Simplifying the Android documentation's example, you should be able to write something like this to allow other apps to share a text string "into" your app:
AndroidManifest.xml
...
<activity android:name="<your_app>.MainActivity">
<!-- Allow users to launch your app directly -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- Allow other apps to "share" with your app -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
...
MainActivity.java
...
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get intent, action and MIME type
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
// Match the intent specified in AndroidManifest.xml
if (Intent.ACTION_SEND.equals(action) && "text/plain".equals(type)) {
handleSendText(intent); // Handle text being sent
}
}
...
If you write most of your application logic in Javascript using React Native, you'll probably want handleSendText
to trigger a Javascript event — see the React Native docs on native modules for information about how to do this.