cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jonathanli2 commented on a change in pull request #98: CB-13555 (ios) Present notification view controller by inappbrowser view controller
Date Thu, 01 Jan 1970 00:00:00 GMT
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_r150916912
 
 

 ##########
 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:
   Sure, I will remove the comment in a new commit.
   
   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


With regards,
Apache Git Services

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


Mime
View raw message