Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share extension doesn't work on iOS 18 and above #64

Open
marko-finmatics opened this issue Dec 19, 2024 · 1 comment
Open

Share extension doesn't work on iOS 18 and above #64

marko-finmatics opened this issue Dec 19, 2024 · 1 comment

Comments

@marko-finmatics
Copy link

marko-finmatics commented Dec 19, 2024

Share extension stopped working for me after iOS version went to 18. The same code runs without any issues on the iOS < 18.

I don't get any errors in the console. When I want to share some file, I see the icon of my app, but when I click on it, nothing happens.

I found potential fix here https://stackoverflow.com/questions/79002378/ios-18-0-shared-extention-open-app-url-cant-work

What could be the problem?

@marko-finmatics
Copy link
Author

Fix that worked for me

        private func redirectToHostApp(type: RedirectType) {
            // load group and app id from build info
            loadIds();
            let url = URL(string: "SharingMedia-\(hostAppBundleIdentifier)://dataUrl=\(sharedKey)#\(type)")
            var responder = self as UIResponder?

            while (responder != nil) {
                if let application = responder as? UIApplication {
                    application.open(url!)
                }
                responder = responder!.next
            }
            extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant