This is an automated email from the ASF dual-hosted git repository.

manuelbeck pushed a commit to branch 
pr-ios-remove-use-of-CDVScreenOrientationDelegate
in repository 
https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git

commit 86204711108709e22d42de2136a03162a1e74cd7
Author: Manuel Beck <[email protected]>
AuthorDate: Fri Jan 30 20:17:44 2026 +0100

    fix(ios): remove use of `CDVScreenOrientationDelegate`
    
    - This is deprecated since cordova-ios 8 and not needed anymore
---
 src/ios/CDVInAppBrowserNavigationController.h |  4 ----
 src/ios/CDVInAppBrowserNavigationController.m | 19 -------------------
 src/ios/CDVWKInAppBrowser.h                   |  5 +----
 src/ios/CDVWKInAppBrowser.m                   | 24 ------------------------
 4 files changed, 1 insertion(+), 51 deletions(-)

diff --git a/src/ios/CDVInAppBrowserNavigationController.h 
b/src/ios/CDVInAppBrowserNavigationController.h
index 1728618..72b3ff6 100644
--- a/src/ios/CDVInAppBrowserNavigationController.h
+++ b/src/ios/CDVInAppBrowserNavigationController.h
@@ -18,11 +18,7 @@
 */
 
 #import <UIKit/UINavigationController.h>
-#import <Cordova/CDVScreenOrientationDelegate.h>
-
 
 @interface CDVInAppBrowserNavigationController : UINavigationController
 
-@property (nonatomic, weak) id <CDVScreenOrientationDelegate> 
orientationDelegate;
-
 @end
diff --git a/src/ios/CDVInAppBrowserNavigationController.m 
b/src/ios/CDVInAppBrowserNavigationController.m
index 2828de3..1f811f0 100644
--- a/src/ios/CDVInAppBrowserNavigationController.m
+++ b/src/ios/CDVInAppBrowserNavigationController.m
@@ -44,23 +44,4 @@
     return rect;
 }
 
-#pragma mark CDVScreenOrientationDelegate
-
-- (BOOL)shouldAutorotate
-{
-    if ((self.orientationDelegate != nil) && [self.orientationDelegate 
respondsToSelector:@selector(shouldAutorotate)]) {
-        return [self.orientationDelegate shouldAutorotate];
-    }
-    return YES;
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-{
-    if ((self.orientationDelegate != nil) && [self.orientationDelegate 
respondsToSelector:@selector(supportedInterfaceOrientations)]) {
-        return [self.orientationDelegate supportedInterfaceOrientations];
-    }
-
-    return 1 << UIInterfaceOrientationPortrait;
-}
-
 @end
diff --git a/src/ios/CDVWKInAppBrowser.h b/src/ios/CDVWKInAppBrowser.h
index cbf196a..2e2e097 100644
--- a/src/ios/CDVWKInAppBrowser.h
+++ b/src/ios/CDVWKInAppBrowser.h
@@ -19,7 +19,6 @@
 
 #import <Cordova/CDVPlugin.h>
 #import <Cordova/CDVInvokedUrlCommand.h>
-#import <Cordova/CDVScreenOrientationDelegate.h>
 #import "CDVWKInAppBrowserUIDelegate.h"
 #import "CDVInAppBrowserOptions.h"
 #import "CDVInAppBrowserNavigationController.h"
@@ -50,8 +49,7 @@
 
 @end
 
-@interface CDVWKInAppBrowserViewController : UIViewController 
<CDVScreenOrientationDelegate,
-                                                               
WKNavigationDelegate,
+@interface CDVWKInAppBrowserViewController : UIViewController 
<WKNavigationDelegate,
                                                                WKUIDelegate,
                                                                
WKScriptMessageHandler,
                                                                
UIAdaptivePresentationControllerDelegate>
@@ -71,7 +69,6 @@
 @property (nonatomic, strong) IBOutlet UIToolbar *toolbar;
 @property (nonatomic, strong) IBOutlet CDVWKInAppBrowserUIDelegate 
*webViewUIDelegate;
 
-@property (nonatomic, weak) id <CDVScreenOrientationDelegate> 
orientationDelegate;
 @property (nonatomic, weak) CDVWKInAppBrowser *navigationDelegate;
 @property (nonatomic) NSURL *currentURL;
 
diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m
index cfd5725..12e8e45 100644
--- a/src/ios/CDVWKInAppBrowser.m
+++ b/src/ios/CDVWKInAppBrowser.m
@@ -150,10 +150,6 @@ static CDVWKInAppBrowser *instance = nil;
     if (self.inAppBrowserViewController == nil) {
         self.inAppBrowserViewController = [[CDVWKInAppBrowserViewController 
alloc] initWithBrowserOptions: browserOptions 
andSettings:self.commandDelegate.settings];
         self.inAppBrowserViewController.navigationDelegate = self;
-        
-        if ([self.viewController 
conformsToProtocol:@protocol(CDVScreenOrientationDelegate)]) {
-            self.inAppBrowserViewController.orientationDelegate = 
(UIViewController <CDVScreenOrientationDelegate> *)self.viewController;
-        }
     }
     
     [self.inAppBrowserViewController showLocationBar:browserOptions.location];
@@ -230,7 +226,6 @@ static CDVWKInAppBrowser *instance = nil;
     
     __block CDVInAppBrowserNavigationController *nav = 
[[CDVInAppBrowserNavigationController alloc]
                                                         
initWithRootViewController:self.inAppBrowserViewController];
-    nav.orientationDelegate = self.inAppBrowserViewController;
     nav.navigationBarHidden = YES;
     nav.modalPresentationStyle = 
self.inAppBrowserViewController.modalPresentationStyle;
     nav.presentationController.delegate = self.inAppBrowserViewController;
@@ -1134,25 +1129,6 @@ BOOL isExiting = FALSE;
     [self.navigationDelegate userContentController:userContentController 
didReceiveScriptMessage:message];
 }
 
-#pragma mark CDVScreenOrientationDelegate
-
-- (BOOL)shouldAutorotate
-{
-    if ((self.orientationDelegate != nil) && [self.orientationDelegate 
respondsToSelector:@selector(shouldAutorotate)]) {
-        return [self.orientationDelegate shouldAutorotate];
-    }
-    return YES;
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-{
-    if ((self.orientationDelegate != nil) && [self.orientationDelegate 
respondsToSelector:@selector(supportedInterfaceOrientations)]) {
-        return [self.orientationDelegate supportedInterfaceOrientations];
-    }
-    
-    return 1 << UIInterfaceOrientationPortrait;
-}
-
 #pragma mark UIAdaptivePresentationControllerDelegate
 
 - (void)presentationControllerWillDismiss:(UIPresentationController 
*)presentationController


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to