ShoutSocial / share_handler

A plugin to facilitate receiving and handling share intents
41 stars 39 forks source link

Does not work with csv #61

Open ebitogu opened 1 year ago

ebitogu commented 1 year ago

I can't get CSV to work. The path is always null

Here is my code

  Future<void> _initShareIntentHandler() async {
    final handler = ShareHandler.instance;
    handler.sharedMediaStream.listen((SharedMedia media) {
      if (!mounted) return;
      print("A CSV was received as ${media.attachments.first.path}"); //Always null
    });
    if (!mounted) return;
  }

Here is my AndroidManifest.xml setup

 <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/*" />
  </intent-filter>
Mounix99 commented 1 year ago

@ebitogu Hi! Use

           <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="*/*" />
            </intent-filter>

For supporting any type of files. You should have both of this filters if you want to have ability share both text and files