I have created an issue for second option https://issues.apache.org/jira/browse/CB-11648 And sent a PR https://github.com/apache/cordova-ios/pull/239
2016-07-27 1:45 GMT+02:00 Shazron <[email protected]>: > Thanks for all your work on this Julio - we should add the second option > for the future. > As for the magic number stuff, its fine for now to fix those issues since > we have no alternative. > > On Fri, Jul 8, 2016 at 6:56 AM, julio cesar sanchez < > [email protected]> > wrote: > > > The statusbar plugin on iOS has had a lot of issues when a modal or > popover > > was present. > > We have been fixing them and adding new ones because the behaviour when a > > modal or popover is present is different on different devices and iOS > > versions. > > We have added a lot of "hacks" to fix a lot of cases. > > > > Right now, there is only one issue left: > > https://issues.apache.org/jira/browse/CB-11191 > > > > But this issue is impossible to fix with our "hacks" because on the > iPhone > > the camera is present on landscape and no rotation event is passed to the > > webview, so when it's closed the webview is resized and not usable. > > > > So, I've come up with an idea, what if we forget about all that hacks and > > just resize the webview when the modal is disappearing? > > > > We have 3 choices (that I know) > > > > 1) Make all plugins that show a modal to post a notification when they > are > > going to be dismissed, and make the statusbar plugin listen for that > > notification. I don't think it's a good option becase it's a lot of work > on > > a lot of plugins and will add a lot of code. > > > > 2) Make the CDVViewController to send the notification on viewWillAppear. > > This option is better, but will only fix the issue on the next version of > > Cordova that includes this code. > > > > 3) Add a category of CDVViewController or MainViewController that have > the > > viewWillAppear, and use it to resize the webView. > > > > > > I've edited the plugin to use the 3rd option > > > > > https://github.com/jcesarmobile/cordova-plugin-statusbar/tree/viewcontroller-category-test > > > > I've been testing and seems to fix all the modal related bugs and removes > > all the hacky code. > > > > Let me know what you think about it or if you know another alternative to > > do the same but easier. > > > > > > And I think we should implement the second choice too for future > releases, > > and maybe with some other methods sending a notification (viewDidAppear, > > viewDidDisappear, etc) > > > > > > BTW, as I asked some time ago and didn't get any answer, I bring the > topic > > again. There are another 2 statusbar issues that can be fixed using a > > "magic number" (20 points as statusbar height constant). The first answer > > was to not use a "magic number" because apple might change the height on > > any moment and break the plugin. iOS 10 hasn't changed it, so I think we > > can use this magic number and worry latter if apple changes it on iOS 11 > or > > 12 or 13, but at least we can have that 2 issues fixed for some years. > > > > The problems are related to the "extended statusbar" (it's 40 points > > instead of 20, so we can't use the real height at that moment and we have > > to use 20 as height to fix both issues) > > >
