[ 
https://issues.apache.org/jira/browse/CB-11422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15327606#comment-15327606
 ] 

ASF GitHub Bot commented on CB-11422:
-------------------------------------

GitHub user jonathanli2 opened a pull request:

    https://github.com/apache/cordova-plugin-splashscreen/pull/105

    fix bug CB-11422 ios SplashScreen plugin may make webview disabled by…

    <!--
    Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist
    is intended as a quick reference, for complete details please see our 
Contributor Guidelines:
    
    http://cordova.apache.org/contribute/contribute_guidelines.html
    
    Thanks!
    -->
    
    ### Platforms affected
    ios
    
    ### What does this PR do?
    Fix bug CB-11422 ios SplashScreen plugin may make webview disabled by 
splash screen plugin
    
    ### What testing has been done on this change?
    Testing with an ios cordova project with splash screen.
    
    ### Checklist
    - [ ] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and 
submitted to secret...@apache.org.
    Yes
    - [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
    Yes
    - [ ] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform 
affected.
    Yes
    - [ ] Added automated test coverage as appropriate for this change.
    
    … not calling destroyView method

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jonathanli2/cordova-plugin-splashscreen master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-splashscreen/pull/105.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #105
    
----
commit 60e3e3381ab0a9481e62fc305919e9c8d0930ab7
Author: Jonathan Li <jonathan...@sap.com>
Date:   2016-06-13T15:05:35Z

    CB-11422: (ios): SplashScreen plugin may make webview disabled by not 
calling destroyView method

----


> ios SplashScreen plugin may make webview disabled by not calling destroyView 
> method
> -----------------------------------------------------------------------------------
>
>                 Key: CB-11422
>                 URL: https://issues.apache.org/jira/browse/CB-11422
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin SplashScreen
>    Affects Versions: 3.5.0
>         Environment: ios
>            Reporter: Jonathan Li
>
> When using ios splash screen, it is noticed sometimes, after the splash 
> screen is dimissed, the ios main uiwebview is disabled. So even if the 
> content in the webview shows properly, but user cannot click on any items on 
> the screen.
> The project adds the splash screen plugin, and use all default settings. 
> The debug shows, when the page loaded is finished, it calls pageDidLoad 
> method, which calls setVisible to NO. Inside the setVisible method, in the 
> dispatch_after block, the completion block will only call destroyViews method 
> if the screen transition is finished at below code block
>     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) 
> effectiveSplashDuration * NSEC_PER_SEC), dispatch_get_main_queue(), 
> CFBridgingRelease(CFBridgingRetain(^(void) {
>                 NSLog(@"splash screen: block %@", NSStringFromSelector(_cmd));
>                   [UIView transitionWithView:self.viewController.view
>                                    duration:(fadeDuration / 1000)
>                                    options:UIViewAnimationOptionTransitionNone
>                                    animations:^(void) {
>                                        [weakSelf hideViews];
>                                    }
>                                    completion:^(BOOL finished) {
>                                       NSLog(@"splash screen: %@ finished %d", 
> NSStringFromSelector(_cmd), finished);
>                                        if (finished) {
>                                            [weakSelf destroyViews];
>                                            // TODO: It might also be nice to 
> have a js event happen here -jm
>                                        }
>                                      }
>                     ];
>             })));
>         }
>     }
> The problem is if the webview is busy to handle other events (in the testing 
> project, there are several update on frame and bounds, so it calls 
> updateImage few times), then the transition will not be finished when 
> completion block is called. As a result, the destroyView will not be called 
> and the userInteractionEnabled is not set to true after the splash screen is 
> dismissed.
> One possible solution is removing the observer and also enable user 
> interaction within setVisible method, as there is no point to continue 
> observer the frame and bound change when splash screen starts to fade out. 
> And it can also be sure the user interaction is always enabled again after 
> dismissing the splash screen.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to