Looking how to import images

This commit is contained in:
Eric van der Vlist 2023-03-16 21:41:51 +01:00
parent 39876031e4
commit c9d231251f
2 changed files with 7 additions and 0 deletions

View File

@ -51,6 +51,12 @@
<data android:mimeType="text/xml" /> <data android:mimeType="text/xml" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="com.darryncampbell.cordova.plugin.intent.ACTION"/> <action android:name="com.darryncampbell.cordova.plugin.intent.ACTION"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>

View File

@ -118,6 +118,7 @@ const Map: Component = () => {
} }
} else if (intent.action === 'android.intent.action.SEND') { } else if (intent.action === 'android.intent.action.SEND') {
const uri = intent.extras['android.intent.extra.STREAM']; const uri = intent.extras['android.intent.extra.STREAM'];
// intent.type is 'image/*' for gallery share
importUrls([uri]); importUrls([uri]);
} }
}); });