| 123456789101112131415161718192021222324 |
- using System;
- using System.Runtime.InteropServices;
- internal static class NativeAppInfo
- {
- #if UNITY_IOS && !UNITY_EDITOR
- [DllImport("__Internal")]
- private static extern IntPtr AppRuntimes_GetTestUserID();
- [DllImport("__Internal")]
- private static extern void AppRuntimes_FreeString(IntPtr value);
- #endif
- internal static string GetTestUrl()
- {
- #if UNITY_IOS && !UNITY_EDITOR
- var value = AppRuntimes_GetTestUserID();
- if (value == IntPtr.Zero) return string.Empty;
- try { return Marshal.PtrToStringAnsi(value) ?? string.Empty; }
- finally { AppRuntimes_FreeString(value); }
- #else
- return string.Empty;
- #endif
- }
- }
|