Application.RequestAdvertisingIdentifierAsync

Switch to Manual
public static bool RequestAdvertisingIdentifierAsync (Application.AdvertisingIdentifierCallback delegateMethod);

Parameters

delegateMethod委托方法。

Returns

bool 如果成功则返回 true,对于不支持广告标识符的平台则返回 false。在这种情况下,不会调用委托方法。

Description

请求 iOS、Android 和 Windows 应用商店的广告 ID。

using System;
using UnityEngine;

public class SampleBehaviour : MonoBehaviour { public void Start() { Application.RequestAdvertisingIdentifierAsync( (string advertisingId, bool trackingEnabled, string error) => { Debug.Log("advertisingId " + advertisingId + " " + trackingEnabled + " " + error); } ); } }