Is there any way to handle sharing files to expo app? According to the documentation of app.json it's possible to provide intentFilters
, but I can't find anything regarding handling them afterwards.
Ejecting is not an option.
Is there any way to handle sharing files to expo app? According to the documentation of app.json it's possible to provide intentFilters
, but I can't find anything regarding handling them afterwards.
Ejecting is not an option.
The documentation says
To add or edit intent filters in an ExpoKit project, edit AndroidManifest.xml directly.
You can see here how to add an intent filter in the manifest, that define the activity (in the example ShareActivity
) that will handle receiving text (you can remove this part) or images
<activity android:name="ShareActivity">
<!-- This activity handles "SEND" actions with text data -->
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
<!-- This activity also handles "SEND" and "SEND_MULTIPLE" with media data -->
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/vnd.google.panorama360+jpg"/>
<data android:mimeType="image/*"/>
<data android:mimeType="video/*"/>
</intent-filter>
</activity>
Then, in your activity in expo.io, you need to get the extra from the Intent
and you will have the info of the attached image