[Share Extension] Move away from deprecated API, implement JS side of things (#5509)
This commit is contained in:
@@ -23,7 +23,7 @@ class ShareViewController: UIViewController {
|
||||
await self.handleUrl(item: firstAttachment)
|
||||
} else if firstAttachment.hasItemConformingToTypeIdentifier("public.image") {
|
||||
await self.handleImages(items: attachments)
|
||||
} else if firstAttachment.hasItemConformingToTypeIdentifier("public.video") {
|
||||
} else if firstAttachment.hasItemConformingToTypeIdentifier("public.movie") {
|
||||
await self.handleVideos(items: attachments)
|
||||
} else {
|
||||
self.completeRequest()
|
||||
@@ -107,7 +107,7 @@ class ShareViewController: UIViewController {
|
||||
let data = try? Data(contentsOf: dataUri)
|
||||
try? data?.write(to: tempUrl)
|
||||
|
||||
if let encoded = dataUri.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed),
|
||||
if let encoded = tempUrl.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed),
|
||||
let url = URL(string: "\(self.appScheme)://intent/compose?videoUri=\(encoded)") {
|
||||
_ = self.openURL(url)
|
||||
}
|
||||
@@ -150,7 +150,8 @@ class ShareViewController: UIViewController {
|
||||
var responder: UIResponder? = self
|
||||
while responder != nil {
|
||||
if let application = responder as? UIApplication {
|
||||
return application.perform(#selector(openURL(_:)), with: url) != nil
|
||||
application.open(url)
|
||||
return true
|
||||
}
|
||||
responder = responder?.next
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user