namespace XmobiTea.MiniDeviceId
{
using System.Runtime.InteropServices;
///
/// Native bridge for the Apple-family keychain plugin used by this package.
/// The native side stores and retrieves a JSON payload containing userId and uuid.
///
internal class CXKeyChain
{
[DllImport("__Internal")]
private static extern string getKeyChainUser();
///
/// Reads the serialized keychain payload from the native plugin.
///
public static string BindGetKeyChainUser()
{
return getKeyChainUser();
}
[DllImport("__Internal")]
private static extern void setKeyChainUser(string userId, string uuid);
///
/// Persists the user slot and generated device UUID through the native plugin.
///
public static void BindSetKeyChainUser(string userId, string uuid)
{
setKeyChainUser(userId, uuid);
}
[DllImport("__Internal")]
private static extern void deleteKeyChainUser();
///
/// Removes the stored keychain payload through the native plugin.
///
public static void BindDeleteKeyChainUser()
{
deleteKeyChainUser();
}
}
}