Skip to content

Commit

Permalink
release: v1.9.0 (#22)
Browse files Browse the repository at this point in the history
## Fix

- fix prevent screenshot, record with `iOS 17` (resolve #21)
  • Loading branch information
wn-na authored Aug 26, 2023
2 parents 554dc4b + 19ef029 commit c283b11
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.example.captureprotection;
PRODUCT_NAME = CaptureProtectionExample;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -529,7 +529,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.example.captureprotection;
PRODUCT_NAME = CaptureProtectionExample;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down
10 changes: 0 additions & 10 deletions ios/CaptureProtection.mm
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,12 @@ - (void)removeRecordProtectionScreen {
});
}

- (UIViewController*) getRootPresentViewController {
UIViewController *viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
while (viewController.presentedViewController) {
viewController = viewController.presentedViewController;
}
return viewController;
}

- (void)secureScreenshotView: (BOOL)isSecure {
dispatch_async(dispatch_get_main_queue(), ^{
if (self->secureTextField == nil) {
self->secureTextField = [[UITextField alloc] init];
self->secureTextField.userInteractionEnabled = false;
UIViewController * rootViewController = [self getRootPresentViewController];
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[rootViewController.view addSubview: self->secureTextField];
[window makeKeyAndVisible];

[window.layer.superlayer addSublayer:self->secureTextField.layer];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-capture-protection",
"version": "1.8.0",
"version": "1.9.0",
"description": "It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit c283b11

Please sign in to comment.