File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -246,11 +246,20 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
246
246
float osVersion = [[[UIDevice currentDevice ] systemVersion ] floatValue ];
247
247
__strong __typeof (weakSelf) strongSelf = weakSelf;
248
248
if (!strongSelf->tmpWindow ) {
249
- CGRect frame = [[UIScreen mainScreen ] bounds ];
250
- if (initHidden && osVersion < 11 ){
251
- frame.origin .x = -10000 ;
249
+ if (@available (iOS 13.0 , *)) {
250
+ UIWindowScene *scene = strongSelf.viewController .view .window .windowScene ;
251
+ if (scene) {
252
+ strongSelf->tmpWindow = [[UIWindow alloc ] initWithWindowScene: scene];
253
+ }
254
+ }
255
+
256
+ if (!strongSelf->tmpWindow ) {
257
+ CGRect frame = [[UIScreen mainScreen ] bounds ];
258
+ if (initHidden && osVersion < 11 ){
259
+ frame.origin .x = -10000 ;
260
+ }
261
+ strongSelf->tmpWindow = [[UIWindow alloc ] initWithFrame: frame];
252
262
}
253
- strongSelf->tmpWindow = [[UIWindow alloc ] initWithFrame: frame];
254
263
}
255
264
UIViewController *tmpController = [[UIViewController alloc ] init ];
256
265
[strongSelf->tmpWindow setRootViewController: tmpController];
You can’t perform that action at this time.
0 commit comments