Receiving data from other apps with share

Hello. I am learning how to build mobile apps for a few days and Expo seems great for my purposes, but i have some problems.

I want to build simple app that receives a simple text data from other apps with share function. User highlights the text, pushes the share button, selects my app in the appearing menu, and my app do something with that data.

Firstly I thought that I should make my app appearing in the menu. I read about android Intent function in android docs and realized that I need to make my app availible to receive data with manifest intent filters. According to Expo docs (https://docs.expo.io/versions/latest/workflow/configuration/#android) I put the following data to my app.json android section:

“intentFilters”: [{
“action”: “android.intent.action.SEND”,
“category”: “DEFAULT”,
“data”: {
“mimeType”: “text/plain”,
}
}]

I built and installed my app as an apk file, but it doesn’t appear in the share menu from any apps.

Also I found an expo IntentLauncher API (https://docs.expo.io/versions/latest/sdk/intent-launcher/) that starts sharing activity:

IntentLauncher.startActivityAsync(“android.intent.action.SEND”, {
type: “text/plain”,
category: “DEFAULT”,
className: “IntentText”
});

But I didn’t find any ways to “listen” to receive the data and examples in the Internet mostly say aboud how to send data, but not to receive.

I want to know what am I doing wrong and if there is a way to provide this functionality without making “eject” or something.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.