Skip to content

Instantly share code, notes, and snippets.

@st0326s
Last active November 24, 2017 08:35
Show Gist options
  • Save st0326s/a535b17c5312e627587656963701bd97 to your computer and use it in GitHub Desktop.
Save st0326s/a535b17c5312e627587656963701bd97 to your computer and use it in GitHub Desktop.
UnityからADID・IDFAを取得 ref: https://qiita.com/satotin/items/f4afb0a08adbec26a062
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GetIdfaAndAdid : MonoBehaviour {
[SerializeField]
public Text DisplayID;
// ボタンが押されると呼ばれる
public void GetID()
{
Debug.Log("■■■■■GetID()■■■■■");
// IDFA
Application.RequestAdvertisingIdentifierAsync(
(string advertisingId, bool trackingEnabled, string error) =>
{
Debug.Log("advertisingId=" + advertisingId + " enabled=" + trackingEnabled + " error=" + error);
DisplayID.text = "advertisingId=" + advertisingId + " enabled=" + trackingEnabled + " error=" + error;
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment