Skip to content

Commit

Permalink
Merge pull request #22 from gbumps/release/0.2.6
Browse files Browse the repository at this point in the history
Release/0.2.6
  • Loading branch information
gbumps committed Sep 23, 2023
2 parents b0ab021 + 8ad7b60 commit e3a2afe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -177,6 +177,7 @@ ScreenGuardModule.registerWithBlurView(data, (_) => {

`Explain`: Set blur radius smaller than 15 won't help much, as content still look very clear and easy to read. Same with bigger than 50 but content will be shrinked and vanished inside the view, blurring is meaningless. So, between 15 and 50 is enough.

iOS

https://github.com/gbumps/react-native-screenguard/assets/16846439/17429686-1bc4-4d5b-aa6c-82616ec8d1c5

Expand Down Expand Up @@ -220,6 +221,14 @@ ScreenGuardModule.registerWithImage(

`Warning`: This feature is still in experimental on Android, so please use with caution as some unexpected behaviour might occurs.

iOS

https://github.com/gbumps/react-native-screenguard/assets/16846439/087dd9d5-b64f-4daf-a804-acc9a3cb4cc2

Android

https://github.com/gbumps/react-native-screenguard/assets/16846439/dd2d8191-555f-4f84-abf5-6cbcf67dc84b

#### 5. unregister

- (iOS + Android) Deactivate the screenguard.
Expand Down
2 changes: 0 additions & 2 deletions example/App.js
Expand Up @@ -72,10 +72,8 @@ function App() {
} }, "Turn on without screenguard")),
React.createElement(View, { style: { height: 72 } }),
React.createElement(Pressable, { onPress: () => {
//CaptureProtection.allowScreenRecord();
ScreenGuardModule.unregister();
setCurrentState('3');
// textInputRef.current?.focus();
} },
React.createElement(Text, { style: {
color: currentState === '3' ? '#00FF00' : Colors.white,
Expand Down
9 changes: 9 additions & 0 deletions ios/ScreenGuard.mm
Expand Up @@ -50,10 +50,19 @@ - (void) initTextField {


- (void)removeScreenShot {
UIWindow *window = [UIApplication sharedApplication].keyWindow;
if (textField != nil) {
if (imageView != nil) {
[imageView setImage: nil];
[imageView removeFromSuperview];
}
[textField setSecureTextEntry: FALSE];
[textField setBackgroundColor: [UIColor clearColor]];
[textField setBackground: nil];
CALayer *textFieldLayer = textField.layer.sublayers.firstObject;
if ([window.layer.superlayer.sublayers containsObject:textFieldLayer]) {
[textFieldLayer removeFromSuperlayer];
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-screenguard",
"version": "0.2.4",
"version": "0.2.6",
"private": false,
"description": "A Native screenshot blocking library for React-Native developer, with background customizable after captured. Screenshot detector are also supported.",
"main": "index",
Expand Down

0 comments on commit e3a2afe

Please sign in to comment.