You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thank you for the work receive_sharing_intent! I am trying to use the "receive any file type" feature (Mentioned in issue #13) , but I am hitting some problems. It is possible that I do not use it correctly.
I am trying to have my application accept binary files with the ".invoice" extension, for example. It seems like I am able now to accept files, but I can not identify the *.invoice extension. This is an issue for me, because I also handle other incoming files with different extensions, like *.index and *.relay, and I am left with no ability to distinguish between different file types.
Below you can see the relevant simplified dart code example. The AndroidManifest.xml file is also included below.
Dart code snippet:
_streamSubs
.add(ReceiveSharingIntent.getMediaStream().listen((List<SharedMediaFile> sharedMediaFiles) {
/* ... Some checks here ... */// We received exactly one filePath:
logger.w(
'fileType = ${sharedMediaFiles[0].type}');
logger.w(
'filePath = ${sharedMediaFiles[0].path}');
}, onError: (err) {
/* .. error handling ... */
}));
Output:
I/flutter (11804): ⚠️ main - fileType = SharedMediaType.FILE
I/flutter (11804): ⚠️ main - filePath = /data/user/0/org.freedomlayer.offset/cache/VID_1587811736322.bin
I was expecting to be able to deduce from either fileType or filePath the original shared file extension, but it seems like I can't identify the file extension. Is this something this receive_sharing_intent plans on supporting?
Contents of androidManifest.xml:
<manifestxmlns:android="http://schemas.android.com/apk/res/android"package="org.freedomlayer.offset">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that calls FlutterMain.startInitialization(this); in its onCreate method. In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. -->
<uses-permissionandroid:name="android.permission.INTERNET"/>
<!-- When we used launchMode="singleTop", a new application instance was created when a file was shared with the application. Using launchMode="singleTask" instead seems to solve this issue -->
<applicationandroid:name="io.flutter.app.FlutterApplication"android:label="Offset"android:icon="@mipmap/ic_launcher">
<activityandroid:name=".MainActivity"android:launchMode="singleTask"android:theme="@style/LaunchTheme"android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"android:hardwareAccelerated="true"android:windowSoftInputMode="adjustResize">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- Handle file sharing intents --><!-- See also: https://stackoverflow.com/questions/1733195/android-intent-filter-for-a-particular-file-extension -->
<intent-filter>
<actionandroid:name="android.intent.action.SEND" />
<categoryandroid:name="android.intent.category.DEFAULT" />
<dataandroid:mimeType="*/*" />
<dataandroid:pathPattern=".*\\.(invoice|receipt|commit|friend|relay|index|rcard)" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-dataandroid:name="flutterEmbedding"android:value="2" />
</application>
</manifest>
Hey, thank you for the work
receive_sharing_intent
! I am trying to use the "receive any file type" feature (Mentioned in issue #13) , but I am hitting some problems. It is possible that I do not use it correctly.I am trying to have my application accept binary files with the ".invoice" extension, for example. It seems like I am able now to accept files, but I can not identify the
*.invoice
extension. This is an issue for me, because I also handle other incoming files with different extensions, like*.index
and*.relay
, and I am left with no ability to distinguish between different file types.Below you can see the relevant simplified dart code example. The AndroidManifest.xml file is also included below.
Dart code snippet:
Output:
I was expecting to be able to deduce from either
fileType
orfilePath
the original shared file extension, but it seems like I can't identify the file extension. Is this something thisreceive_sharing_intent
plans on supporting?Contents of androidManifest.xml:
Possibly also related to issue: #51
The text was updated successfully, but these errors were encountered: