简体   繁体   English

如何设计在验证时选择SIM并在iOS中获取唯一ID?

[英]How to design choose the SIM and get a unique id in iOS while authentication?

A) In android i can get the SIM details and can specifically choose the SIM for sending the OTP from that SIM. A) 在 android 中,我可以获得 SIM 详细信息,并且可以专门选择用于从该 SIM 发送 OTP 的 SIM。 I have a sample screen which is possible to implement in Android.我有一个示例屏幕,可以在 Android 中实现。

I followed the link for ios How can I get details about the device data provider (like Verizon/AT&T) of an iphone programmatically?我点击了 ios 的链接如何以编程方式获取有关 iphone 的设备数据提供程序(如 Verizon/AT&T)的详细信息?

https://developer.apple.com/forums/thread/9171 This link states we cant get the SIM Phone numbers from device because of Apple Privacy policy https://developer.apple.com/forums/thread/9171此链接声明由于 Apple 隐私政策,我们无法从设备获取 SIM 电话号码

How to implement the same screen in iOS? iOS如何实现同屏? Any alternative idea or help is appreciated任何替代想法或帮助表示赞赏

B) How to get the Unique id for authentication? B) 如何获取用于身份验证的 Unique id?

In Android we can get (IMEI+SIM Serial number) can be used for authentication but in iOS all these are restricted due to privacy.在 Android 中我们可以获得(IMEI+SIM 序列号)可用于身份验证,但在 iOS 中所有这些都因隐私而受到限制。 Instead it is impossible to get UDID which is unique for every device.相反,不可能获得每个设备唯一的 UDID。 I know i can use vendor id for this:我知道我可以为此使用供应商 ID:

UIDevice.current.identifierForVendor!.uuidString

But as the documentation says: The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor's apps from the device and subsequently reinstalls one or more of them.但正如文档所述: The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor's apps from the device and subsequently reinstalls one or more of them. The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor's apps from the device and subsequently reinstalls one or more of them.

Since the vendor id changes when the user uninstalls the Application.So is it any way around to get a unique id other than Vendor ID for authentication which doesn't change and is unique all time?由于当用户卸载应用程序时供应商 ID 会发生变化。那么是否有任何方法可以获取除供应商 ID 之外的唯一 ID 以进行身份验证,该 ID 不会更改并且始终是唯一的?

How to get SIM phone number?如何获取SIM卡电话号码?

As it stated in the question, its not available to get the phone number due to the security reasons.正如问题中所述,由于安全原因,无法获取电话号码。 I suggest you to have a textfield and let user to enter the numbers, so you can send the sms to verify it我建议你有一个文本字段,让用户输入数字,这样你就可以发送短信来验证它

How to get the Unique id for authentication?如何获取用于身份验证的唯一标识?

You have two options here based on your deployment target needs:根据您的部署目标需求,您在这里有两个选择:

  1. Apple has come up with the DeviceCheck framework in iOS 11. Your app should use the DeviceCheck APIs to generate an ephemeral token that identifies a device. Apple 在 iOS 11 中提出了DeviceCheck框架。您的应用程序应使用 DeviceCheck API 生成标识设备的临时令牌。 Your associated server combines this token with an authentication key that you receive from Apple and uses the result to request access to the per-device bits.您关联的服务器将此令牌与您从 Apple 收到的身份验证密钥结合起来,并使用结果请求访问每个设备位。 Very intentionally by Apple, DeviceCheck tokens can not be used to identify the specific device. Apple 有意为之,DeviceCheck 令牌不能用于识别特定设备。 But you can try playing to get unique identifier for the iOS device state但是您可以尝试播放以获取 iOS 设备的唯一标识符 state

  2. Create your own unique ID and save it in the keychain .创建您自己的唯一 ID 并将其保存在钥匙串中。

References参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM