I'm new to Xamarin Forms iOS and I want to get token value after Login.
I want to get previous User Login response token and make it authorization header in GET Procurement List. Kindly help to enlighten what is missing/wrong.
CodePudding user response:
Please use Xamarin.Essentials to save Token
value on login success response. Please get its value like below, when ever you need it to pass in header.
The Preferences class helps to store application preferences in a key/value store.
To save a value:
Preferences.Set("my_key", "my_value");
To get a value:
var myValue = Preferences.Get("my_key", "default_value");
Refer to know more about preferences: https://learn.microsoft.com/en-us/xamarin/essentials/preferences?tabs=android
Hope this helps.!