Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PrivacyScreenPlugin.m #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/ios/PrivacyScreenPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -152,4 +163,4 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
return imageName;
}

@end
@end