Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Share Extension is not working on iOS 13?

I was using a Share extension in my app in order to import audio files and it was working on iOS12. Now in iOS 13 is not working anymore, when I press the share button my app doesn't appear in the share sheet. I think that maybe something has changed in the plist or similar but I coudn't find any information. Does anyone have the same problem?

NB: I don't wanna use the copy - paste strategies, only the share extension.

like image 821
Fab Avatar asked Oct 08 '19 11:10

Fab


1 Answers

Try this for iOS 13

    DispatchQueue.main.async {

      let activityItem = URL.init(fileURLWithPath: Bundle.main.path(forResource: "audio", ofType: "mp3")!)

      let activityVC = UIActivityViewController(activityItems: [activityItem],applicationActivities: nil)
      activityVC.popoverPresentationController?.sourceView = self.view

      self.present(activityVC, animated: true, completion: nil)
    }
like image 56
Nick Avatar answered Nov 15 '22 00:11

Nick