Last active
November 24, 2017 08:35
-
-
Save st0326s/a535b17c5312e627587656963701bd97 to your computer and use it in GitHub Desktop.
UnityからADID・IDFAを取得 ref: https://qiita.com/satotin/items/f4afb0a08adbec26a062
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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