Closed espresso3389 closed 3 years ago
Unfortunately, there's no workaround to this but making a breaking change to provide the value as String
.
But I'm not sure to get your point. Apparently, you get called back by the package with a lowercased value, didn't you? If so, you can already process it, why couldn't you?
Apparently, you get called back by the package with a lowercased value, didn't you? If so, you can already process it, why couldn't you?
For me, if there would be another version of AppLinks constructor/factory that accepts a function with String parameter, it's completely acceptable. Otherwise, I will do some of so much ugly (and not complete) workaround like the following fragment:
_appLinks = AppLinks(onAppLink: (uri) async {
// very ugly workaround to recover Slack's original URI:
final uriStr = uri.toString().replaceFirst('content://com.slack.fileprovider/', 'content://com.Slack.fileprovider/');
...
});
This is now available in version 2.1.0
This is ultimately not an issue with the plugin but Slack Android app send ACTION_VIEW with URIs like
content://com.Slack.fileprovider/slack_files/xxx.jpg
. The URI hostname has capitalizedS
in it and Dart's Uri constructor make the hostname lower-case during processing it.As the result, the app receives
content://com.slack.fileprovider/slack_files/xxx.jpg
and it cannot resolve the content with the lower-cased URI.I need some workaround not to use
Uri.parse
or... something special to handle such problematic URI.