簡體   English   中英

如何設計在驗證時選擇SIM並在iOS中獲取唯一ID?

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

A) 在 android 中,我可以獲得 SIM 詳細信息,並且可以專門選擇用於從該 SIM 發送 OTP 的 SIM。 我有一個示例屏幕,可以在 Android 中實現。

我點擊了 ios 的鏈接如何以編程方式獲取有關 iphone 的設備數據提供程序(如 Verizon/AT&T)的詳細信息?

https://developer.apple.com/forums/thread/9171此鏈接聲明由於 Apple 隱私政策,我們無法從設備獲取 SIM 電話號碼

iOS如何實現同屏? 任何替代想法或幫助表示贊賞

B) 如何獲取用於身份驗證的 Unique id?

在 Android 中我們可以獲得(IMEI+SIM 序列號)可用於身份驗證,但在 iOS 中所有這些都因隱私而受到限制。 相反,不可能獲得每個設備唯一的 UDID。 我知道我可以為此使用供應商 ID:

UIDevice.current.identifierForVendor!.uuidString

但正如文檔所述: 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.

由於當用戶卸載應用程序時供應商 ID 會發生變化。那么是否有任何方法可以獲取除供應商 ID 之外的唯一 ID 以進行身份驗證,該 ID 不會更改並且始終是唯一的?

如何獲取SIM卡電話號碼?

正如問題中所述,由於安全原因,無法獲取電話號碼。 我建議你有一個文本字段,讓用戶輸入數字,這樣你就可以發送短信來驗證它

如何獲取用於身份驗證的唯一標識?

根據您的部署目標需求,您在這里有兩個選擇:

  1. Apple 在 iOS 11 中提出了DeviceCheck框架。您的應用程序應使用 DeviceCheck API 生成標識設備的臨時令牌。 您關聯的服務器將此令牌與您從 Apple 收到的身份驗證密鑰結合起來,並使用結果請求訪問每個設備位。 Apple 有意為之,DeviceCheck 令牌不能用於識別特定設備。 但是您可以嘗試播放以獲取 iOS 設備的唯一標識符 state

  2. 創建您自己的唯一 ID 並將其保存在鑰匙串中。

參考

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM