From e2e6a98d2249a89799217e3ad6056529158996d0 Mon Sep 17 00:00:00 2001 From: mounikasai-961 <57220038+mounikasai-961@users.noreply.github.com> Date: Tue, 24 Dec 2019 16:04:13 +0530 Subject: [PATCH] Update PrivacyScreenPlugin.m --- src/ios/PrivacyScreenPlugin.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ios/PrivacyScreenPlugin.m b/src/ios/PrivacyScreenPlugin.m index 67303ee..e4cf414 100644 --- a/src/ios/PrivacyScreenPlugin.m +++ b/src/ios/PrivacyScreenPlugin.m @@ -17,6 +17,9 @@ - (void)pluginInitialize [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillResignActive:) name:UIApplicationWillResignActiveNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIScreen.capturedDidChangeNotification:) + name:UIScreen.capturedDidChangeNotification object:nil]; + } - (void)onAppDidBecomeActive:(UIApplication *)application @@ -47,6 +50,14 @@ - (void)onAppWillResignActive:(UIApplication *)application #endif } } +- (void)onUIScreen.capturedDidChangeNotification:(UIApplication *)application +{ + if (imageView == NULL) { + self.viewController.view.window.hidden = NO; + } else { + [imageView removeFromSuperview]; + } +} // Code below borrowed from the CDV splashscreen plugin @ https://github.com/apache/cordova-plugin-splashscreen // Made some adjustments though, becuase landscape splashscreens are not available for iphone < 6 plus @@ -152,4 +163,4 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i return imageName; } -@end \ No newline at end of file +@end