-
Notifications
You must be signed in to change notification settings - Fork 589
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
Open and Save image on iOS13 - does not return to correct view #294
Comments
@drewwynne0 Can you upload a basic example? I will test it in xcode to see if I can fix the issue. |
@drewwynne0 I have tested this with xcode and iOS 13 simulator, it opens the dialog correctly and after saving the image, it returns to the app itself. Can you please show a screenshot of what is it showing on your device? |
@pwlin Thank you for testing. I will put together an example for you over the coming days. I think the key part is that the inappbrowser needs to be in use. I have the index just as a white screen so nothing really to show in the screenshot, but in the example I will leave it as stock so you will return to the Cordova Default index page you get when you launch the app, just with no touch events working because they are still tied to the browser. |
@pwlin thanks for the example - made things easier! I have added a new branch - https://github.com/pwlin/example-fileopener2-ios/tree/%23294 - If you launch the app - open the image - then click back - you will see the browser where I have loaded codepen. |
Try to run that project and look in the code for I think that is how you call other plugins in inappbrowser plugin. |
@pwlin I do currently use the messaging system like you suggest to trigger the download of the file from the web server to the app, then use this plugin to open from the local file copy. I was going to setup that whole mechanism through codepen, but I was actually able to replicate the issue without having to go that far. My understanding is that the way views are handled natively has slightly changed with iOS13. Here is a post and thread discussing it on SO - https://stackoverflow.com/a/57798040 I also checked on 13.5 and still an issue. Do you want me to add the messaging part into codepen? The result is the same but if it will help you diagnose further I am happy to update the branch to include it. |
@pwlin Do you think that article is related to this issue? Have you had chance to investigate further? Let me know if you want me to add the messaging. |
@drewwynne0 I am sorry I have not got time to really look into it. Last time I have checked the code in your branch was not clear. Please create a clear use-case example in master branch without the reference to codepen or anything external. You can commit your external pages into a sub-folder. Also as i mentioned before calling 2 functions one after another will not work, so try to commit anything you have into master branch so I can see exactly how are you using |
Expected Behaviour
When saving an image on iOS13, return to the previous view as it does in iOS12.
Actual Behaviour
When saving an image on iOS13, it returns to the incorrect view. This works fine in iOS12.
Tried latest beta 13.5, still does not work.
If I open an image, select the share options and Save Image, the preview is closed, but it returns to the cordova core view, not the last view. If the last view was the inAppBrowser, the core view is displayed instead, but you cannot interact with the page until you hide the inappbrowser.
Reproduce Scenario (including but not limited to)
If the last view was the inAppBrowser, the core view is displayed instead, but you cannot interact with the page until you hide the inappbrowser.
Steps to Reproduce
open an image, select the share options and Save Image
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS13
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
n/a
Cordova CLI info
Here is the output:
[email protected] with:
[email protected]
[email protected]
[email protected]
[email protected]
Environment:
OS: darwin
Node: v10.16.3
npm: 6.9.0
...
iOS platform:
Xcode 11.4.1
...
cordova-plugin-file 6.0.2 “File”
cordova-plugin-file-opener2 3.0.1 “File Opener2”
cordova-plugin-inappbrowser 3.2.0 “InAppBrowser”
cordova-plugin-ionic-webview 4.2.1 “cordova-plugin-ionic-webview”
Plugin version
Here is the output:
cordova-plugin-file-opener2 3.0.1 “File Opener2”
Sample Code that illustrates the problem
This opens the image, but is not the cause.
cordova.plugins.fileOpener2.open(
file,
fileType,
{
error : function(e){
console.log('open error');
console.log(e);
},
success : function(e){
console.log('open success');
console.log(e);
}
}
);
Logs taken while reproducing problem
No logs. This SO thread may help though:
https://stackoverflow.com/questions/56903030/ios-13-uiactivityviewcontroller-automatically-present-previous-vc-after-image-sa
The text was updated successfully, but these errors were encountered: