Skip to content

Commit

Permalink
update 1.1.3
Browse files Browse the repository at this point in the history
- remove windows module(not work correct)
- fix ios disable secure view
  • Loading branch information
killserver committed Jun 16, 2023
1 parent ca95dab commit 307e120
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 600 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ declare module 'react-native-screenshot-prevent' {
export function disableSecureView(): void;
export function usePreventScreenshot(): void;
export function useDisableSecureView(): void;
export function addListener(fn: Function) => void;
}
10 changes: 0 additions & 10 deletions index.windows.ts

This file was deleted.

16 changes: 11 additions & 5 deletions ios/RNScreenshotPrevent.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)handleAppStateActive {
/** sends screenshot taken event into app */
- (void) handleAppScreenshotNotification {
// only send events when we have some listeners
if(hasListeners){
if(hasListeners) {
[self sendEventWithName:@"userDidTakeScreenshot" body:nil];
}
}
Expand Down Expand Up @@ -116,9 +116,11 @@ -(void) addSecureTextFieldToView:(UIView *) view {
// TODO: not working now, fix crash on _UITextFieldCanvasView contenttViewInvalidated: unrecognized selector sent to instance
-(void) removeSecureTextFieldFromView:(UIView *) view {
for(UITextField *subview in view.subviews){
if([subview isMemberOfClass:[UITextField class]]){
if(subview.secureTextEntry == TRUE){
if([subview isMemberOfClass:[UITextField class]]) {
if(subview.secureTextEntry == TRUE) {
[subview removeFromSuperview];
subview.secureTextEntry = FALSE;
secureField.userInteractionEnabled = TRUE;
}
}
}
Expand All @@ -132,9 +134,9 @@ -(void) removeSecureTextFieldFromView:(UIView *) view {

/** adds secure textfield view */
RCT_EXPORT_METHOD(enableSecureView){
if(secureField.secureTextEntry == false){
if(secureField.secureTextEntry == false) {
UIView *view = [UIApplication sharedApplication].keyWindow.rootViewController.view;
for(UIView *subview in view.subviews){
for(UIView *subview in view.subviews) {
[self addSecureTextFieldToView:subview];
}
}
Expand All @@ -143,6 +145,10 @@ -(void) removeSecureTextFieldFromView:(UIView *) view {
/** removes secure textfield from the view */
RCT_EXPORT_METHOD(disableSecureView) {
secureField.secureTextEntry = false;
UIView *view = [UIApplication sharedApplication].keyWindow.rootViewController.view;
for(UIView *subview in view.subviews) {
[self removeSecureTextFieldFromView:subview];
}
}


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-screenshot-prevent",
"version": "1.1.2",
"version": "1.1.3",
"description": "This fork contains fully working blank screenshot on IOS13+ including screen recording",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
92 changes: 0 additions & 92 deletions windows/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions windows/ExperimentalFeatures.props

This file was deleted.

14 changes: 0 additions & 14 deletions windows/NuGet.Config

This file was deleted.

Loading

0 comments on commit 307e120

Please sign in to comment.