Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TinyStuff/TinyAccountManager
Account manager for Xamarin and UWP
https://github.com/TinyStuff/TinyAccountManager
android ios uwp windows xamarin
Last synced: 30 days ago
JSON representation
Account manager for Xamarin and UWP
- Host: GitHub
- URL: https://github.com/TinyStuff/TinyAccountManager
- Owner: TinyStuff
- License: mit
- Created: 2017-11-27T21:30:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T07:40:09.000Z (over 6 years ago)
- Last Synced: 2024-11-11T05:53:42.566Z (about 1 month ago)
- Topics: android, ios, uwp, windows, xamarin
- Language: C#
- Homepage:
- Size: 255 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - TinyAccountManager ★13
README
# Xamarin.Essentials
Xamarin.Essentials will have this functionallity, please take a look at it. But we will continue to maintain TinyAccountMananger for thoose who use it.
https://docs.microsoft.com/en-us/xamarin/essentials/# TinyAccountManager
Account manager for Xamarin and UWP. Store account information in your app in a secure way.## Build status
| Platform | Status |
|---|---|
| iOS | |
| Android | |
| UWP | |## Get started
This is as short guide how to get started using TinyAccountManager.### How to install
The easiest way is to install the package from NuGet:```
Install-Package TinyAccountManager
```You should install it on all your platform project and if you have other projects in your solution where you want to access it, you should install it there as well.
### How to use
Here is a small get started guide, there are also a sample project if you take a look in the src folder.#### Initialization
The first you need to do is to initialize the AccountManager per platform.```csharp
//iOS
TinyAccountManager.iOS.AccountManager.Initialize();//Android
TinyAccountManager.Droid.AccountManager.Initialize();//UWP
TinyAccountManager.UWP.AccountManager.Initialize();
```#### Save
The only filed that are required is ServiceId.```csharp
var account = new Account()
{
ServiceId = "TinyAccountManagerSample",
Username = "dhindrik"
};account.Properties.Add("Password", "MySecretPassword");
await AccountMananger.Current.Save(account);
```#### Get and Exists
It's recommended that you use Exists before Get, if you using Get and there is no matching account it will throw an exception.
```csharp
Account account = null;var exists = await AccountManager.Current.Exists("TinyAccountManagerSample")
if(exists)
account = await AccountManager.Current.Get("TinyAccountManagerSample")
```#### Remove
```csharp
await AccountManager.Current.Remove("TinyAccountManagerSample")
```#### IOC
If you want to use IOC instead of the singleton pattern, you just register the implemenation for each platform with the IAccountManager interface. If you select this way you don't have to run Initialize on each platform**iOS:** iOSAccountManager
**Android:** AndroidAccountManager
**UWP:** UWPAccountManager