jcesarmobile commented on code in PR #190:
URL:
https://github.com/apache/cordova-plugin-dialogs/pull/190#discussion_r2423534054
##########
src/ios/CDVNotification.m:
##########
@@ -149,14 +149,39 @@ - (void)beep:(CDVInvokedUrlCommand*)command
}
-(UIViewController *)getTopPresentedViewController {
+ UIWindow *keyWindow = nil;
+
+ if (@available(iOS 13.0, *)) {
+ // iOS 13+ approach - get the first active window scene
+ // Since iOS 13, Apple introduced UIScene and multiple window support.
+ // The deprecated keyWindow property doesn't work reliably with
multiple scenes
+ // as it returns a key window across all connected scenes, which can
be from
+ // different app instances or windows. We need to find the active
foreground
+ // scene to get the correct window for presenting our alert.
+ for (UIWindowScene *windowScene in [UIApplication
sharedApplication].connectedScenes) {
+ if (windowScene.activationState ==
UISceneActivationStateForegroundActive) {
+ keyWindow = windowScene.windows.firstObject;
+ break;
+ }
+ }
+ } else {
+ // Fallback for iOS 11-12
Review Comment:
> > Not everybody submit apps to the Apple App Store, so in those cases
there are no Xcode restrictions and people can have real devices to test with
those older iOS versions.
>
> Do this really do people? Do know real examples, or this just a guess? I
mean also with the old os versions.
>
> Thanks for the hint with the dev list, I will try this.
Yeah, since mac computers are expensive there are people not being able to
buy them so often and use older versions with older Xcode versions since Apple
also requires certain OS versions for using latest Xcode versions.
Apple allows "in house" distribution of apps for enterprise customers that
since are hosted on the enterprise servers don't have Xcode version
restrictions.
Also allows installing the apps from Xcode directly, even without a paid
developer license nowadays.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]