簡體   English   中英

如何禁止 iOS 和 Android 設備登錄我的應用程序

[英]How can I banned an iOS & Android devices from login to my app

我正在尋找一種方法來禁止 iOS 和 Android 設備在他們的設備上使用我的應用程序。

通過使用IMEIUUID或如何做到這一點。

Snapchat 在 iOS 和 Android 上阻止了用戶的設備他們是如何做到的,他們選擇的方法是什么?

現在我們無法獲取 Android/iOS 設備的 UUID 或 IMEI,因為系統不允許我們。

在iOS中,您可以將數據(key-value)保存在Keychain中,直到您恢復出廠設置才能恢復。 因此,您通常可以將其用作設備的標識符。

這是一個簡單而有用的,可幫助您向 iOS 設備的鑰匙串寫入/讀取內容。

例子:

let deviceId = UUID().uuidString
let keychain = Keychain(service: "com.example.github-token") // you can put whatever but I recommend to use your app's bundleId
keychain["device_id"] = deviceId // save it.


// In you API request function
let keychain = Keychain(service: "com.example.github-token") // same above
let deviceId = keychain["device_id"]


// Then submit this deviceId to BE then you can verify that if this device is on the whitelist or blacklist.
// If it is on blacklist, just return error to client.

暫無
暫無

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

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