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/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]; 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",