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

Sharing app freeze after 2nd share (iOS 12) #12

Closed
ygyg70 opened this issue Dec 17, 2018 · 7 comments
Closed

Sharing app freeze after 2nd share (iOS 12) #12

ygyg70 opened this issue Dec 17, 2018 · 7 comments

Comments

@ygyg70
Copy link

ygyg70 commented Dec 17, 2018

This started happening with iOS 12
2nd time I share Safari page I get this dialog, and when canceling the Safari is frozen and I have to kill it (see attachment)
image

@grexican
Copy link

Ditto. Trying to dig in to figure out what's going on but I'm not an iOS dev so I don't know enough about the app lifecycle to really figure out what's going on. What it seems is that the invisible window (layer? layout? storyboard?) is blocking the rest of the app. I put on DEBUG level logging, and didn't learn anything new. Still digging to see what I can find!

@grexican
Copy link

grexican commented Dec 22, 2018

I got it! Here's what you need to change:

- (void) viewDidAppear:(BOOL)animated {
    [self.view endEditing:YES];
}

- (void) viewDidLoad {

What you want to do is basically move the viewDidLoad content to the viewDidAppear body. So remove the closing } of viewDidAppear and the - (void) viewDidLoad { so that the two methods are merged, and the whole thing loads/runs within viewDidAppear. You end up with

- (void) viewDidAppear:(BOOL)animated {
    [self.view endEditing:YES];
    [self setup];
    [self debug:@"[viewDidLoad]"];

if you want to be correct, change the debug statement to viewDidAppear instead of viewDidLoad. But whatever!

Doing that solves the problem. You still see a brief flash of the share dialog on the second share as it's switching to your app, but that's a-ok with me for now.

@grexican
Copy link

Here's my PR for the fix. If you look at the diff, you'll see the changes: #13

@ygyg70
Copy link
Author

ygyg70 commented Dec 22, 2018

Tried and seems to work for me :)
Would be nice if someone proficient with iOS would review the change...

@brandon-bt
Copy link

Thank you. I was having issues with the iOS Files app freezing when I attempted to share items from there, as well. This fixed it.

@grexican
Copy link

PR isn't getting merged by repo owner. If you want to use my working version, you can do cordova plugin add https://github.com/grexican/cordova-plugin-openwith-ios.git to pull from mine.

FWIW I'm currently using @ygy6g70 's repository at https://github.com/ygyg70/cordova-plugin-openwith.git but I'm having trouble getting it to work with android. So I might pull back and revert to using my openwith and go back to using the Web Intent package for android.

EtienneLem added a commit to missive/cordova-plugin-openwith that referenced this issue Mar 13, 2019
bendspoons added a commit to bendspoons/cordova-plugin-openwith-ios that referenced this issue Jan 21, 2020
@EternallLight
Copy link
Owner

@grexican thank you very much for the suggested fix! It will be included in the version 2 of the plugin

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

4 participants