KeyChain.cs 666 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEngine;
  2. using System.Runtime.InteropServices;
  3. public class KeyChain {
  4. #if UNITY_IPHONE || UNITY_STANDALONE_OSX
  5. [DllImport("__Internal")]
  6. private static extern string getKeyChainUser();
  7. public static string BindGetKeyChainUser()
  8. {
  9. return getKeyChainUser();
  10. }
  11. [DllImport("__Internal")]
  12. private static extern void setKeyChainUser(string userId, string uuid);
  13. public static void BindSetKeyChainUser(string userId, string uuid)
  14. {
  15. setKeyChainUser(userId, uuid);
  16. }
  17. [DllImport("__Internal")]
  18. private static extern void deleteKeyChainUser();
  19. public static void BindDeleteKeyChainUser()
  20. {
  21. deleteKeyChainUser();
  22. }
  23. #endif
  24. }