case .text, .url:
if let text = data as? String {
this.handleMedia(forLiteral: text,
type: type,
index: index,
content: content)
}
When data is a URL, text = data as? String will evaluate to nil, resulting in empty lists when emitting events.
One possible solution is to have a separate case for .url and use handleMedia:forLiteral with url.absoluteString
But since I haven't deep dive into the rest of the package code, I'm not sure this covers everything.
Using version 1.6.6
App opens as expected
getMediaStream
emits events but the value (List<SharedMediaFile>
) is always empty.After some debugging, I've found the culprit in
RSIShareViewController
,viewDidAppear
: https://github.com/KasemJaffer/receive_sharing_intent/blob/a0f4d8ea8008fcb62687441904c25481d8883375/ios/Classes/RSIShareViewController.swift#L56When data is a URL,
text = data as? String
will evaluate tonil
, resulting in empty lists when emitting events.One possible solution is to have a separate case for
.url
and usehandleMedia:forLiteral
withurl.absoluteString
But since I haven't deep dive into the rest of the package code, I'm not sure this covers everything.@KasemJaffer what do you think?