supportedInterfaceOrientations not get called after update to IOS 16

The orientation for IOS mobiles was locked with the below function in a swift file.

extension CAPBridgeViewController {
public override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
if UIDevice.current.userInterfaceIdiom == .phone {
if(lockOrientations) {
return [UIInterfaceOrientationMask.portrait];
} else {
return [UIInterfaceOrientationMask.landscapeLeft,UIInterfaceOrientationMask.landscapeRight, UIInterfaceOrientationMask.portrait];
}
} else {
return [UIInterfaceOrientationMask.landscapeLeft,UIInterfaceOrientationMask.landscapeRight];
}
}

after the IOS 16 update this method didn’t get called with the mobile orientation change.So capacitor was also updated for the version 4.0 and it still do not get called when a screen orientation change.

below is the package.json file

@capacitor-community/electron”: “^4.0.3”,
@capacitor-community/http”: “^1.4.1”,
@capacitor/android”: “^4.0.0”,
@capacitor/app”: “^4.0.0”,
@capacitor/app-launcher”: “^4.0.0”,
@capacitor/browser”: “^4.0.0”,
@capacitor/core”: “^4.0.0”,
@capacitor/device”: “^4.0.0”,
@capacitor/dialog”: “^4.0.0”,
@capacitor/filesystem”: “^4.0.0”,
@capacitor/ios”: “^4.0.0”,
@capacitor/keyboard”: “^4.0.0”,
@capacitor/network”: “^4.0.0”,
@capacitor/preferences”: “^4.0.0”,
@capacitor/push-notifications”: “^4.0.0”,
@capacitor/splash-screen”: “^4.0.0”,
@capacitor/status-bar”: “^4.0.0”,