【问题标题】:user's AppleId programmatically in iphone用户的 AppleId 在 iphone 中以编程方式
【发布时间】:2014-11-17 07:33:03
【问题描述】:

这是否可以获取当前登录设备的用户的苹果 ID?实际上,我实现了应用内购买,当用户购买应用时,我得到了用户的设备 ID 和 Apple ID。

【问题讨论】:

    标签: ios apple-id


    【解决方案1】:

    不,这是不可能的。
    您可以使用 [[UIDevice currentDevice] identifierForVendor] 代替 AppleId。

    【讨论】:

      【解决方案2】:

      不,你不能。它是一个类似于 UDID 的隐私元素。

      您可以在此处阅读更多信息:Privacy issue

      但是,如果您愿意,您可以使用 Apple 提供的identifierForVendor 使用此方法:

      [[UIDevice currentDevice] identifierForVendor]
      

      【讨论】:

        【解决方案3】:

        这是不可能的。您只能检索设备的 UDID。这是一个隐私问题,就像他们的电话号码一样。但是您可以从苹果服务器为特定用户的每次购买获取证书(确认)。

        【讨论】:

          【解决方案4】:

          不,您无法获得 Apple ID。取而代之的是,您可以使用 identifierForVendor。

          目标-c:

          [[UIDevice currentDevice] identifierForVendor]
          

          Swift 3+:

          UIDevice.current.identifierForVendor?.uuidString
          

          如果您想了解更多关于收集用户数据的信息,请查看Apple Policy!

          或者你可以使用这个(Swift 3):

          UIDevice.current.identifierForVendor!.uuidString

          对于旧版本:

          UIDevice.currentDevice().identifierForVendor

          或者如果你想要一个字符串:

          UIDevice.currentDevice().identifierForVendor!.UUIDString

          【讨论】:

            【解决方案5】:

            我不确定苹果 ID,但您可以通过编程方式获取设备 ID。如果您使用混合应用程序,则可以使用推送 phonegap 插件。

            https://github.com/phonegap-build/PushPlugin

            http://blog.revivalx.com/2014/08/29/implement-push-notifications-for-android-and-ios-phonegap-part-2/

            原生

            http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

            顺便说一句,设备 id 和 UDID 是不同的东西。

            【讨论】:

            • 我必须检索 apple id 而不是 device id 。当前由哪个用户登录?
            • 设备 id 你可以从用户那里得到它,如果我认为苹果 id 不能。我从来没有听说过。
            【解决方案6】:

            不,您无法获取该信息。您唯一可以获得的信息是来自 UIDevice 的信息(在苹果文档中查找)或使用 [[UIDevice currentDevice] identifierForVendor] 的“假 UDID”(不是 UDID 的唯一密钥)和 IP。

            因此您可以以独特的方式识别您的用户,但无法获取他们的信息。

            我真的建议你去浏览关于 UIDevice 的文档,也许你会在那里找到你需要的东西

            【讨论】:

              【解决方案7】:

              你可以使用这个(Swift 3):

              UIDevice.current.identifierForVendor!.uuidString 对于旧版本:

              UIDevice.currentDevice().identifierForVendor 或者如果你想要一个字符串:

              UIDevice.currentDevice().identifierForVendor!.UUIDString

              【讨论】:

                猜你喜欢
                • 2012-09-30
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2014-04-01
                • 2010-12-11
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                相关资源
                最近更新 更多