Fab
Fab

Reputation: 836

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.

Upvotes: 7

Views: 2707

Answers (2)

Santhosh Muthu
Santhosh Muthu

Reputation: 1

For IOS 13 you Should add below code inside your open url method.

UISceneOpenExternalURLOptions * options = [[UISceneOpenExternalURLOptions alloc] init];
options.universalLinksOnly = false;

Upvotes: 0

Nick
Nick

Reputation: 875

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)
    }

Upvotes: 1

Related Questions