From bc389431e66ff2634c7919cceb314c3f9052446c Mon Sep 17 00:00:00 2001 From: Lethe <37437842+0xlethe@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:30:25 +0900 Subject: [PATCH 1/2] fix: iOS 17 didnt work prevent screenshot --- ios/CaptureProtection.mm | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ios/CaptureProtection.mm b/ios/CaptureProtection.mm index 5947d20..ad2bca3 100644 --- a/ios/CaptureProtection.mm +++ b/ios/CaptureProtection.mm @@ -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]; From 19ef0295190df33f060e4f2f035c570e460109ea Mon Sep 17 00:00:00 2001 From: Lethe <37437842+0xlethe@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:42:51 +0900 Subject: [PATCH 2/2] chore: update version v1.9.0 --- .../ios/CaptureProtectionExample.xcodeproj/project.pbxproj | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/ios/CaptureProtectionExample.xcodeproj/project.pbxproj b/example/ios/CaptureProtectionExample.xcodeproj/project.pbxproj index 396ba85..aecb570 100644 --- a/example/ios/CaptureProtectionExample.xcodeproj/project.pbxproj +++ b/example/ios/CaptureProtectionExample.xcodeproj/project.pbxproj @@ -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"; @@ -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; diff --git a/package.json b/package.json index 4621f3c..45694ce 100644 --- a/package.json +++ b/package.json @@ -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",