Essentials: Clear SecureStorage when the app is unistalled

Created on 6 Mar 2019  路  3Comments  路  Source: xamarin/Essentials

Bug report best practices: Submitting Issues

Description

Not sure if is possible but whenever the app iOS is unistalled I would like the securestorage to be cleared ,so that the user is asked to register with the app again.

Is it possible?

Steps to Reproduce

  1. Save "a key" using the keystore
  2. Unistall the app
  3. securestorage still remembers the "key or id" used to identify the app

is there anything that I can do so that when the app is unistalled the securestorage is cleared?

thanks

question

Most helpful comment

I'd imagine you would also be able to use Xamarin Essentials for what they described in that StackOverflow thread:

App.xaml.cs

protected async override void OnStart()
{
    if (VersionTracking.IsFirstLaunchEver)
    {
        SecureStorage.Remove("token");
    }

    // proceed with OnStart() logic
}

All 3 comments

Since you can't run code when an app is uninstalled this is just a general iOS/Android thing and not with Xamarin.Essentials at all. Here is a good thread highlighting: https://stackoverflow.com/questions/4747404/delete-keychain-items-when-an-app-is-uninstalled

You could leverage "Preferences" itself to purge out the Keychain.

Many thanks for link.that link worked

I'd imagine you would also be able to use Xamarin Essentials for what they described in that StackOverflow thread:

App.xaml.cs

protected async override void OnStart()
{
    if (VersionTracking.IsFirstLaunchEver)
    {
        SecureStorage.Remove("token");
    }

    // proceed with OnStart() logic
}
Was this page helpful?
0 / 5 - 0 ratings