如何在 Unity3D 中获取用于在 iOS 上测试 Admob 的测试设备 ID

How to get test device id for testing Admob on iOS in Unity3D

我正在 iOS 游戏中实施 AdMob,使用 UNITY3D,我想知道是否有任何方法可以直接从 Unity 或任何其他方式获取设备哈希 ID(用于 AdMob)而无需 Xcode。条件是我想向客户演示 AdMob 而他没有 mac/xcode,那么如何获取我可以放入 admob 的测试设备列表中的设备 ID。

对于 Android,我发现 one app on play store 工作正常,但对于 iOS。

只需计算广告标识符的 MD5 并将其用作您的测试设备 ID - Source

这里是apple's documentation获取广告标识。检查部分 Getting the Advertising Identifier

The ASIdentifierManager class provides apps with access to an identifier that can be used only for serving advertisements, as well as a flag which indicates whether a user has limited ad tracking.

This class is expected to be used by developers who are implementing a system for serving ads. These organizations typically provide app developers with the code that interacts with this class. App developers may need to link against the Ad Support framework to use that code, but they should not need to interact with the ASIdentifierManager class directly.

To get the advertising identifier:

  1. Get a reference to the shared instance of this class using the sharedManager method.

  2. Check whether advertising tracking is limited using the advertisingTrackingEnabled property.

If the user has limited ad tracking, use the advertising identifier only for the following purposes: frequency capping, attribution, conversion events, estimating the number of unique users, advertising fraud detection, and debugging.

  1. Get the advertising identifier using the advertisingIdentifier property.