Open tempo-riz opened 1 month ago
You can differentiate between mimetypes, I did it to not break my other deeplinks like:
`void subscribeIntentDataStream() { if (_intentSub != null) { return; } _intentSub = ReceiveSharingIntent.instance.getMediaStream().listen((value) { bool isSharedMedia = value.any((item) => item.mimeType.toString().startsWith('image') || item.mimeType.toString().startsWith('video') || item.mimeType.toString().startsWith('document') || item.mimeType.toString().startsWith('text'));
if (value.isNotEmpty && isSharedMedia) {
Messenger.initShareMedia(value);
_navigateToSharedMediaPage();
}
}, onError: (err) {
Logger.logError("getIntentDataStream error: $err");
});
}
In your case you can look if its an audio:
item.mimeType.toString().startsWith('audio')
Thanks @CodingCrog but I was looking for a step before, if possible to allow only to share audio, with your solution users will be able to share any filetype, but if it's not audio it will just open the app and do nothing. I don't know if that's possible tho...
I want to recieve only audio files (public.audio) How can i show my app in the dialog only for audio files please ?