【问题标题】:Titanium.Platform.id contains UUID or UDID for Android and iOS?Titanium.Platform.id 包含 Android 和 iOS 的 UUID 或 UDID?
【发布时间】:2016-01-29 12:41:37
【问题描述】:

根据 appcelerator 的文档:

Titanium.Platform.id : StringREADONLY
Applications's globally-unique ID (UUID).

On Android, this may be the UDID (unique device ID). For iOS, this is a unique identifier for this install of the application.

Previously on iOS this may have been a UDID, but access to this has been restricted by Apple.

在 Android 上它是否返回 UDID 或任何其他唯一标识符,因为文档说它可能是 UDID。

除了 iOS 唯一的 UUID 可用,它是否与以下 CFUUID、NSUUID 或供应商标识符中的任何一个相同。

【问题讨论】:

    标签: android ios appcelerator appcelerator-titanium


    【解决方案1】:

    对于 Android,Ti.Platform.id 使用 TiPlatformHelper.getInstance().getMobileId(),它继承自 Appcelerator Analytics 的封闭源代码 APSAnalyticsHelper 助手。我无法分享源代码,但它基本上是我们生成并存储在持久性 sqlite 数据库中的 UUID。

    对于 iOS,它使用 TiUtils.appIdentifier,它基本上做同样的事情。

    所以,回答您的问题:两者都使用生成并持久存储的 UUID。只是 UUID 的格式在两个平台上有所不同。

    【讨论】:

      【解决方案2】:

      我记录了 Ti.Platform.id,我得到的结果如下

      |Ti.Platform.id | Username | Login | Ti.Platform.name - Ti.Platform.version | Ti.Platform.manufacturer + " - " + Ti.Platform.model;
      
      | Platform ID                          | User   | Login | OS                | Device          |
      |--------------------------------------|--------|-------|-------------------|-----------------|
      | 538B1B72-FFFF-FFFF-FFFF-192A09BEF0CB | demoiOS| 1     | iPhone OS - 8.1.2 | apple - iPad3,4 |
      | bb6bffffd1695d0d                     | demo   | 1     | android - 4.4.4   | Sony - D6503    |
      

      虽然你应该明白这一点,但我已经编辑了部分 ID。

      在他们的源代码中我只能找到这个:

      titanium_mobile/android/modules/platform/src/java/ti/modules/titanium/platform/PlatformModule.java

      @Kroll.method
          public String createUUID() {
              return TiPlatformHelper.getInstance().createUUID();
          }
      

      哪个是java钩子,但是我找不到TiPlatformHelper给你确切的答案

      您可能想检查此代码,但我找不到正确的方法 Titanium GitHub project link

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-11-11
        • 2013-06-22
        • 2018-08-02
        • 2013-01-30
        相关资源
        最近更新 更多