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