Clear SecureStorage except one!

Jassim Al Rahma 1,591 Reputation points
2021-10-22T00:18:32.613+00:00

Hi,

How can I clear all SecureStorage except one which is named Country

SecureStorage.GetAsync("Country")

Thanks,
Jassim

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,376 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,273 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 79,471 Reputation points Microsoft Vendor
    2021-10-22T06:05:46.297+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    How can I clear all SecureStorage except one which is named Country

    1.You can call the SecureStorage.GetAsync("Country") to save the value in your application.

    2.Then call SecureStorage.RemoveAll(); to remove the all keys.

    1. Set the Courntry key await SecureStorage.SetAsync("Country", "xxxxxxx");, Now your achieve the Clear SecureStorage except Country key.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.