How to change the taken screenshot in app background switcher iOS

MadMadMadMad USMember

Hi everyone,

I want to secure sensible data in my app, so I want to change the screenshot taken for the app background switcher with the application icon for example.

I know that I have to code that in appDelegate.cs > DidEnterBackground but i can't find an example to change the screenshot.

Regards.

Tagged:

Best Answers

Answers

  • JohnHairJohnHair GBMember ✭✭✭✭

    I think what you want is to display a full screen view with the image you want when you receive the WillEnterBackground notification.

  • MadMadMadMad USMember

    Hi,

    thanks for you reply, I want to do something like in the attached photo. I want to change the content of my app's screenshot on the multitasking switcher.

  • JohnHairJohnHair GBMember ✭✭✭✭

    That is the screenshot taken of your app when it goes into background. So I suggest you detect when your app will go into background and display your image then.

  • MadMadMadMad USMember

    Yeah! thank you John :smile:

  • BipsBips INMember

    Hey Madmad,

    I want to doing this same think on xamarin Android
    If you have anything for android than please share

    public Page myPage;
    protected override async void OnSleep ()
    {
    myPage = App.Current.MainPage;
    Device.BeginInvokeOnMainThread (() => {
    App.Current.MainPage = new NavigationPage(new BaseClass());
    });

        System.Diagnostics.Debug.WriteLine ("Sleep");
    }
    
    protected override void OnResume ()
    {
        App.Current.MainPage = myPage;
        System.Diagnostics.Debug.WriteLine ("Resume");
    }
    

    I'm trying with above code and it's working fine in iOS but not working for Android.
    Please suggest some solution for Android.

    Thanks

  • AnkitGAnkitG INMember ✭✭

    @MadMad ,
    I would like to implement the same thing what you have mention, i have tried above given code however its throws error like "Foundation.ModelNotImplementedException: Exception of type 'Foundation.ModelNotImplementedException' was thrown."
    Can you please provide source code what you have implemented or demo code for the same.
    Also if you can provide same for the android that would be also a great help.

    Thanks,
    Ankit.

Sign In or Register to comment.