ShoutSocial / share_handler

A plugin to facilitate receiving and handling share intents
43 stars 45 forks source link

Not working in iOS 18 #96

Closed Zhanweelee closed 1 month ago

Zhanweelee commented 1 month ago

I try to use example in git repo, and debug in ShareHandlerIosViewController, i noticed that we use "openURL" and it's deprecated now. So after share from safari or files app, it flashed and not redirecting to host app.

I've received an error message in console

BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO).

https://github.com/user-attachments/assets/85b60762-76c5-49a7-aea7-7f9798235b59

Is it a known issue and any solutions?

Zhanweelee commented 1 month ago

This is screen recording of Debug process in Xcode 2024-09-11 17 09 49

The device is iPhone 14 Pro with iOS Version 18.0

Zhanweelee commented 1 month ago

Btw, i've already copy the value of url (which is ShareMedia-im.listen.shareHandlerIosExample://im.listen.shareHandlerIosExample?key=ShareKey) to safari and open manually, it can redirect to the app successfully.

But not working in share extension

dbrpci commented 1 month ago

I ran into this today as well after upgrading my device to iOS 18. Poor timing as I just released our app adding this feature yesterday.

I just opened a PR to resolve it: https://github.com/ShoutSocial/share_handler/pull/98

I do not know Swift well, so I'm sure there are opportunities to improve this code, but it got sharing working on iOS 18 for me (had to copy share_handler to my project and adjust pubspec.yaml to use path:).

arrrrny commented 1 month ago

I created a new package zikzak_share_handler In case this package is no longer maintained, I applied @dbrpci fix for IOS and it works.