cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13555) (ios) Present notification view controller by inappbrowser view controller
Date Tue, 14 Nov 2017 16:47:00 GMT

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

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

jonathanli2 commented on a change in pull request #98: CB-13555 (ios) Present notification
view controller by inappbrowser view controller
URL: https://github.com/apache/cordova-plugin-dialogs/pull/98#discussion_r150892340
 
 

 ##########
 File path: src/ios/CDVNotification.m
 ##########
 @@ -228,9 +228,19 @@ - (void)beep:(CDVInvokedUrlCommand*)command
 
 -(UIViewController *)getTopPresentedViewController {
     UIViewController *presentingViewController = self.viewController;
-    while(presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController
isBeingDismissed])
-    {
-        presentingViewController = presentingViewController.presentedViewController;
+    if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow){
+        //for wkwebview, the privacy screen plugin is presented from a different window object
+        presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
+        while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController
isBeingDismissed]){
+            presentingViewController = presentingViewController.presentedViewController;
+        }
+    }
+    else {
+        //for uiwebview viewcontroller, if inappbrowser or privacyscreen viewcontroller is
presented,
+        //then they should be used to repsent the new view control.
+        while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController
isBeingDismissed]){
 
 Review comment:
   The while clause will be moved out the if-else block; and the whole else block will be
removed. 
   
   Should I keep the below comment in the if block? 
    "//for wkwebview, the privacy screen plugin is presented from a different window object"
   
   Jonathan

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> (ios) Present notification view controller by inappbrowser view controller
> --------------------------------------------------------------------------
>
>                 Key: CB-13555
>                 URL: https://issues.apache.org/jira/browse/CB-13555
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-dialogs
>    Affects Versions: cordova-ios 4.5.0
>         Environment: IOS 10 and 11
>            Reporter: Jonathan Li
>              Labels: dialog, inappbrowser
>             Fix For: Master
>
>
> When inappbrowser window is shown, if main uiwebview or wkwebview calls cordova Dialog
plugin method to show the dialog view, the dialog should show to user on top of the inappbrowser
view controller.
> However, currently the dialog view is shown behind the inappbrowser view, so user cannot
see it or click button on the dialog 
> An similar issue was reported for barcode scanner plugin at 
> https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/570
> The issue can be repeated with the below method
> function confirm(){
>     var win = window.open( "https://www.google.com", "_blank" );
>     win.addEventListener( "loadstop", function() {
>     setTimeout(function() {
>          function onConfirm(buttonIndex) {
>             console.log('You selected button ' + buttonIndex);
>         }
>         
>         navigator.notification.confirm(
>             'You are the winner!', // message
>             onConfirm,            // callback to invoke with index of button pressed
>             'Game Over',           // title
>             ['Restart','Exit']     // buttonLabels
> );
>     }, 1000 );
> });
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message