modules/expo-receive-android-intents/README.md
An Expo module that handles incoming Android intents for sharing text, images, and videos into the Bluesky app.
This module intercepts Android share intents (when a user shares content from another app to Bluesky) and converts them into deep links that the app can handle. It supports:
The module operates entirely in native Android code and requires no JavaScript API calls. It automatically registers itself with Expo's module system and handles intents when the app is launched or receives new intents.
The module uses Expo's module lifecycle hooks to intercept Android intents at two key moments:
ACTION_SEND or ACTION_SEND_MULTIPLE intentbluesky://intent/compose URL with encoded parametersuseIntentHandlerThe module generates deep links in the following formats:
# Text only
bluesky://intent/compose?text=<encoded-text>
# Images (single or multiple)
bluesky://intent/compose?imageUris=<uri1>|<width>|<height>,<uri2>|<width>|<height>&text=<encoded-text>
# Video (single only)
bluesky://intent/compose?videoUri=<uri>|<width>|<height>&text=<encoded-text>
All URIs use the file:// scheme pointing to files in the app's cache directory. Dimensions are included to avoid expensive measurement operations in JavaScript.
useIntentHandler.ts) validates image URIs with a regex to prevent external URLshttp:// or https:// are filtered outExpoReceiveAndroidIntentsModule.kt - Main module class with intent handling logic
handleIntent() - Routes intents based on typehandleTextIntent() - Processes text sharinghandleAttachmentIntent() - Processes single image/videohandleAttachmentsIntent() - Processes multiple imagesgetImageInfo() - Saves images to cache and extracts dimensionsgetVideoInfo() - Extracts video dimensions using MediaMetadataRetrieverandroid/build.gradle - Gradle build configuration
android/src/main/AndroidManifest.xml - Empty manifest (intent filters configured in main app)
The deep links generated by this module are handled by:
useComposeIntent() parses the deep link parameters and opens the composer with pre-populated contentNo manual installation is required. Gradle automatically includes this module during the Android build process. The module is auto-linked through Expo's module system.
Intent filters must be configured in the main app's AndroidManifest.xml to declare which MIME types the app accepts. The module itself has an empty manifest.
The module uses version-specific APIs for Android 13+ (API 33):
getParcelableExtra() with type parameter on Android 13+getParcelableExtra() on older versionsFile.createTempFile() in the app's cache directory.jpeg extension and are compressed at 100% quality.mp4 if none is detected