How to make app thumbnail unreadable or replace with static image on going to background

Hi,
we're developing an app which contains confidential data. On returning from background the user must always enter a passcode. But in the switcher screen an app thumbnail is visible and all the app page content is readable. Is it possible to set the thumbnail opacity, blur it or replace with a static image (e.g. company logo) to protect the sensitive data? I tried those things on Application.MainPage in OnSleep method but apparently it is too late and the thumbnail (screenshot) is already taken. Is there any other method?

Answers

  • JulienRosenJulienRosen CAMember ✭✭✭✭
    edited January 2016

    Don't think you are going to have much luck here. There isn't going to be a way to "clean" the switcher screenshot, not sure how you get past that. The only thing I can think of is forcing the user to interact with the screen to show sensitive information, like holding their finger down or something, and even then they could still just background the app and you'd be screwed.

  • AdamMeaneyAdamMeaney USMember ✭✭✭✭✭

    In iOS, there are a few ways I have seen people try.

    This thread shows a few of them.

    Android, top of my head I don't have any simple ways, but could probably roll something with OnStop/OnPause.

  • PrzemyslawJanikPrzemyslawJanik USMember
    edited February 2016

    I found a solution, for both environments. For Android, it's just:
    Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);
    which I added in MainActivity.OnCreate.
    For iOS, I had to override 2 methods in AppDelegate:

    `
    public override void OnResignActivation(UIApplication uiApplication)
    {
    base.OnResignActivation(uiApplication);

            var almostInvisible = (nfloat) 0.1;
            uiApplication.KeyWindow.Alpha = almostInvisible;
        }
    
        public override void OnActivated(UIApplication uiApplication)
        {
            base.OnActivated(uiApplication);
    
            var opaque = (nfloat) 1;
            uiApplication.KeyWindow.Alpha = opaque;
        }
    

    `
    To make the thumbnail completely black, you can set Alpha to zero.

Sign In or Register to comment.