기기 식별자
AppSealing 기기 고유 식별자 획득
Section titled “AppSealing 기기 고유 식별자 획득”AppSealing SDK는 각 기기에 대한 고유 식별자를 생성하고 관리합니다.
Xamarin.iOS에서 기기 ID 획득
Section titled “Xamarin.iOS에서 기기 ID 획득”using System;using ObjCRuntime;
[DllImport("__Internal")]static extern int ObjC_GetAppSealingDeviceID(IntPtr deviceId);
public string GetDeviceId(){ var buffer = Marshal.AllocHGlobal(64); try { var result = ObjC_GetAppSealingDeviceID(buffer); if (result == 0) { return Marshal.PtrToStringAnsi(buffer); } return null; } finally { Marshal.FreeHGlobal(buffer); }}
public override void ViewDidAppear(bool animated){ base.ViewDidAppear(animated);
string deviceId = GetDeviceId(); if (!string.IsNullOrEmpty(deviceId)) { var alert = UIAlertController.Create("AppSealing Device ID", deviceId, UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("확인", UIAlertActionStyle.Default, null)); PresentViewController(alert, true, null); }}