diff options
author | Jan-Olof Eriksson <jan-olof.eriksson@iki.fi> | 2024-02-29 11:55:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 11:55:03 +0200 |
commit | 963a44ab872a1044d6997a8fcf7b2fc754ac618a (patch) | |
tree | bbd64f464a8f14e55cbb06e28811cdc43f059d29 /plugins/shareExtension/withIntentFilters.js | |
parent | 1f9562847512bb41cd8bb381b735a388be4db59b (diff) | |
parent | a35976cdc9b6467ad8b6e0c4ff46ba684fee9064 (diff) | |
download | voidsky-963a44ab872a1044d6997a8fcf7b2fc754ac618a.tar.zst |
Merge branch 'bluesky-social:main' into main
Diffstat (limited to 'plugins/shareExtension/withIntentFilters.js')
-rw-r--r-- | plugins/shareExtension/withIntentFilters.js | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/plugins/shareExtension/withIntentFilters.js b/plugins/shareExtension/withIntentFilters.js new file mode 100644 index 000000000..605fcfd05 --- /dev/null +++ b/plugins/shareExtension/withIntentFilters.js @@ -0,0 +1,89 @@ +const {withAndroidManifest} = require('@expo/config-plugins') + +const withIntentFilters = config => { + // eslint-disable-next-line no-shadow + return withAndroidManifest(config, config => { + const intents = [ + { + action: [ + { + $: { + 'android:name': 'android.intent.action.SEND', + }, + }, + ], + category: [ + { + $: { + 'android:name': 'android.intent.category.DEFAULT', + }, + }, + ], + data: [ + { + $: { + 'android:mimeType': 'image/*', + }, + }, + ], + }, + { + action: [ + { + $: { + 'android:name': 'android.intent.action.SEND', + }, + }, + ], + category: [ + { + $: { + 'android:name': 'android.intent.category.DEFAULT', + }, + }, + ], + data: [ + { + $: { + 'android:mimeType': 'text/plain', + }, + }, + ], + }, + { + action: [ + { + $: { + 'android:name': 'android.intent.action.SEND_MULTIPLE', + }, + }, + ], + category: [ + { + $: { + 'android:name': 'android.intent.category.DEFAULT', + }, + }, + ], + data: [ + { + $: { + 'android:mimeType': 'image/*', + }, + }, + ], + }, + ] + + const intentFilter = + config.modResults.manifest.application?.[0].activity?.[0]['intent-filter'] + + if (intentFilter) { + intentFilter.push(...intents) + } + + return config + }) +} + +module.exports = {withIntentFilters} |