Screen capture lock on mobile application
Question

Hi guys!

I need to block the screen capture of a specific screen or block in mobile applications, does anyone know how I can do this block? 

I saw the plugin Privacy Screen Plugin, but it doesn’t serve me, I need to block it on both Android and iOS.

thankful

mvp_badge
MVP
Solution

Murilo,

I just added some more functionality and changed the way of using it check in the Component page:


What’s new (1.0.1)

Updated the way of using it.
Now you set the default behavior you want for all your application. Using the OnApplicationReady:


Then you can override the option is default screens using the OnInitialize and OnDestroy of this giving screen.

For example, let's just enable the  screen shot functionality for just one screen.

In the screen OnInitialize function we place:

This will enable the functionality.

Then to go back to the default behavior we need to Disable it again on the On Destroy.

So on the OnDestroy action of that screen, we place:



You can keep the default behavior as you want, to enable or disable it for all app, and override it for just one specific screen.

This way you may be able to either, disable this functionality to all app in an easy way or let it enabled for all app and just block in a specific screen


Raphael Ranieri wrote:

Murilo,

I just added some more functionality and changed the way of using it check in the Component page:


What’s new (1.0.1)

Updated the way of using it.
Now you set the default behavior you want for all your application. Using the OnApplicationReady:


Then you can override the option is default screens using the OnInitialize and OnDestroy of this giving screen.

For example, let's just enable the  screen shot functionality for just one screen.

In the screen OnInitialize function we place:

This will enable the functionality.

Then to go back to the default behavior we need to Disable it again on the On Destroy.

So on the OnDestroy action of that screen, we place:



You can keep the default behavior as you want, to enable or disable it for all app, and override it for just one specific screen.

This way you may be able to either, disable this functionality to all app in an easy way or let it enabled for all app and just block in a specific screen


Thank you very much for your help with the plugin Raphael Ranieri, but unfortunately it didn't work on iOS, being able to capture the screen normally, do you know of any other way to block the capture also on iOS?

thankful

 

mvp_badge
MVP
Solution

Hi Murilo,

I also didn't find any plugin for both platforms in Forge, so I just made one for you...


Since you need it quickly I uploaded it with just one function, to prevent the user to take a print for one screen.

I tested in android and it is working.


Here it is

To use it, just place DisableScreenShot action on the OnInitilize of the screen you don't want the user to take the print, like this:



In future I will improve it and make it better looking.

Just added ASAP so you can use it.


I did not tested in iOS but it also should work.


Also it will work just in the native apps installed in devices, you will not be able to test ir in Browser or PWA.


Let me know if you have any issue with it.

Hope it helps,

Cheers and Regards,

RR :)

Hi Murilo,

The  Privacy Screen Plugin is a mobile native plugin. It works on both the iOS and Android. 

Also, have a look at https://success.outsystems.com/Documentation/10/Delivering_Mobile_Apps/Customize_Your_Mobile_App/Use_Custom_Splash_Screens

Regards,

Swatantra

Swatantra Kumar wrote:

Hi Murilo,

The  Privacy Screen Plugin is a mobile native plugin. It works on both the iOS and Android. 

Also, have a look at https://success.outsystems.com/Documentation/10/Delivering_Mobile_Apps/Customize_Your_Mobile_App/Use_Custom_Splash_Screens

Regards,

Swatantra

Hi Swatantra Kumar,

I don't need to change the splash, I need to block the screen capture

 

mvp_badge
MVP
Solution

Hi Murilo,

I also didn't find any plugin for both platforms in Forge, so I just made one for you...


Since you need it quickly I uploaded it with just one function, to prevent the user to take a print for one screen.

I tested in android and it is working.


Here it is

To use it, just place DisableScreenShot action on the OnInitilize of the screen you don't want the user to take the print, like this:



In future I will improve it and make it better looking.

Just added ASAP so you can use it.


I did not tested in iOS but it also should work.


Also it will work just in the native apps installed in devices, you will not be able to test ir in Browser or PWA.


Let me know if you have any issue with it.

Hope it helps,

Cheers and Regards,

RR :)

mvp_badge
MVP
Solution

Murilo,

I just added some more functionality and changed the way of using it check in the Component page:


What’s new (1.0.1)

Updated the way of using it.
Now you set the default behavior you want for all your application. Using the OnApplicationReady:


Then you can override the option is default screens using the OnInitialize and OnDestroy of this giving screen.

For example, let's just enable the  screen shot functionality for just one screen.

In the screen OnInitialize function we place:

This will enable the functionality.

Then to go back to the default behavior we need to Disable it again on the On Destroy.

So on the OnDestroy action of that screen, we place:



You can keep the default behavior as you want, to enable or disable it for all app, and override it for just one specific screen.

This way you may be able to either, disable this functionality to all app in an easy way or let it enabled for all app and just block in a specific screen


Raphael Ranieri wrote:

Murilo,

I just added some more functionality and changed the way of using it check in the Component page:


What’s new (1.0.1)

Updated the way of using it.
Now you set the default behavior you want for all your application. Using the OnApplicationReady:


Then you can override the option is default screens using the OnInitialize and OnDestroy of this giving screen.

For example, let's just enable the  screen shot functionality for just one screen.

In the screen OnInitialize function we place:

This will enable the functionality.

Then to go back to the default behavior we need to Disable it again on the On Destroy.

So on the OnDestroy action of that screen, we place:



You can keep the default behavior as you want, to enable or disable it for all app, and override it for just one specific screen.

This way you may be able to either, disable this functionality to all app in an easy way or let it enabled for all app and just block in a specific screen


Thank you very much for your help with the plugin Raphael Ranieri, but unfortunately it didn't work on iOS, being able to capture the screen normally, do you know of any other way to block the capture also on iOS?

thankful

 

mvp_badge
MVP

Hi Murilo,

You tested it with a generated IPA or from browser?

Raphael Ranieri wrote:

Hi Murilo,

You tested it with a generated IPA or from browser?

Raphael Ranieri, i did the test with the IPA.

 

mvp_badge
MVP

Murilo,

I will try to get any Iphone where I can test it for you...

Will let you know about any updates... It should work...


mvp_badge
MVP

Hi Murilo, 

I searched a little bit deeper on this.

And even if the cordova plugin says it supports iOS on the GitHub... I think it really does not.

I found some posts in Stack Overflow saying that it os not possible to prevent a screenShot in an iOS device. See:


Even Snapchat can't do it and tried other solutions like this one above using the touch event (Which also is no longer valid). Now you can just be aware that the screenshot was taken, and show something for example or warn the User.


I think this functionality of warn the User that is supported by the plugin I used, and I can try to implement it with some event callback to you do something if user take a screenshot in iOS. Let me know if this would help.


The only thing I found that could not prevent but at least change the print, is this plugin you tried ScreenPrivacy, and another one that blurs the image, but don't prevent the User from taking it. If this would work for you I can also try to implement it in another component... Let me know.


I'm sorry that this one I implemented didn't work for iOS, since it was saying to support All iOS versions I was Hopeful!


Cheers and Regards,
RR :)


Raphael Ranieri wrote:

Hi Murilo, 

I searched a little bit deeper on this.

And even if the cordova plugin says it supports iOS on the GitHub... I think it really does not.

I found some posts in Stack Overflow saying that it os not possible to prevent a screenShot in an iOS device. See:


Even Snapchat can't do it and tried other solutions like this one above using the touch event (Which also is no longer valid). Now you can just be aware that the screenshot was taken, and show something for example or warn the User.


I think this functionality of warn the User that is supported by the plugin I used, and I can try to implement it with some event callback to you do something if user take a screenshot in iOS. Let me know if this would help.


The only thing I found that could not prevent but at least change the print, is this plugin you tried ScreenPrivacy, and another one that blurs the image, but don't prevent the User from taking it. If this would work for you I can also try to implement it in another component... Let me know.


I'm sorry that this one I implemented didn't work for iOS, since it was saying to support All iOS versions I was Hopeful!


Cheers and Regards,
RR :)


Raphael Ranieri, i also researched a lot about, and I did not find any solution for iOS, only for Android, the functionality to warn the user that is supported by the plugin, will help me a lot.

Greetings

 

mvp_badge
MVP

Hi Murilo!
I'm sorry for the delay, things have been busy around here but I have some news!


I checked the plugin code and seems like it have the function to detect screenshot on iOS by default, so I just adapted it so you can use in your Mobile Apps using the component.


However it had not this functionality for android, and since I think things must be equal whenever possible I researched a little bit and developed it also for android.


I will explain what I did for your knowledge.

First I had to clone the original github and make some changes.

Through these two stack overflow topics I was able to see how to implement this in Android and how I could adapt it to cordova:

https://stackoverflow.com/questions/31360296/listen-for-screenshot-action-in-android

https://stackoverflow.com/questions/54939027/triggering-javascript-event-from-android


However since Android don't have a default event for taking a ScreenShot, the option commonly used (Even by Snapchat) is to create an observer that keep checking if while the app is opened any file created have the name 'screenshot'.


Personally I don't think it is a very good way to do it, but is the only option I found. And looks like the Big Ones (Like Snapchat) also use it, so I accepted it for now at least :)


Since it needs to check for new files you will need the permission to Read External Storage, which is handled by the app.


 I made this option in android optional, so you can choose to use it or not.


Right now in the app you will be able to: 

-Prevent the user from taking screenshots in android only.

-Detect a screenshot taken by an User in both, iOS and Android.

-Set the default behavior for all app or for a specific screen

-Set the default callback for all app or for a specific screen


I added a sample module in Component Page, so you can see how to use it.


Let me know if it worked well.


Cheers and Regards,

RR :)


mvp_badge
MVP

Hi Murilo!

Were you able to solve your issue?

Let me know if the plugin worked as expected if you used ;)

Tkss

RR 

Hi Raphael Ranieri!

For my implementation, I need to make some changes to meet my needs, but the GIT repository is excellent, and its plugin is well attended.

Thanks

mvp_badge
MVP

Great Murilo! :)

If there is any more functions that you need let me know I can try to add to this component too...

Happy to help.

Cheers and regards,

RR

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.