简体   繁体   English

如何禁止 iOS 和 Android 设备登录我的应用程序

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

I am looking for a way to ban iOS and Android devices from using my application on their devices.我正在寻找一种方法来禁止 iOS 和 Android 设备在他们的设备上使用我的应用程序。

by using IMEI or UUID or how can do it.通过使用IMEIUUID或如何做到这一点。

Snapchat blocked users' devices on iOS and Android how do they do it what is the methods they chose for? Snapchat 在 iOS 和 Android 上阻止了用户的设备他们是如何做到的,他们选择的方法是什么?

Now we can not get UUID or IMEI of Android/iOS device, because System doesn't allow us.现在我们无法获取 Android/iOS 设备的 UUID 或 IMEI,因为系统不允许我们。

In iOS, you can save data (key-value) in Keychain, which is persisted until you reset to factory setting for restore.在iOS中,您可以将数据(key-value)保存在Keychain中,直到您恢复出厂设置才能恢复。 So you can mostly use it as device's identifier.因此,您通常可以将其用作设备的标识符。

Here is a simple and useful lib that help you to write/read something to/from Keychain of an iOS device.这是一个简单而有用的,可帮助您向 iOS 设备的钥匙串写入/读取内容。

Example:例子:

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.

相关问题 如何为多个设备测试我的 android 应用程序? - How Can I test my android app for multiple devices? 如何让我的应用程序将从 android 设备中卸载 - How can I get my app is going to uninstall from android devices 如何从 android 设备中删除我的应用程序? - how do i delete my app from android devices? 如何在我的 android 应用程序中使用全局变量从 mysql 检索用户的登录 ID? - how can I retrieve user's login id from mysql using global variable in my android app? 如何在不使用应用商店的情况下使用类似于iOS设备的清单文件来部署android应用? - How can I deploy android apps using a manifest file, similar to iOS devices, without using an app store? 我无法在某些设备上启动我的Android应用 - I can't launch my Android app on some devices 如何知道我的Android应用在用户设备上消耗了多少电量? - How can I find out how much battery my Android app consumes on user's devices? Harmony OS 中禁止了哪些谷歌服务(这是我在 android 应用程序中使用的列表。) - What google services are banned in Harmony OS (here is a list that I have used in my android app.) 我的Flash应用程序如何在所有Android设备中正确匹配? - How can my flash app fit correctly in all Android devices? 如何从 UIImagePickerController 将 iOS 视频编码为 .mp4 以便 Android 设备可以播放它们? - How do I encode iOS videos as .mp4 from UIImagePickerController so that Android devices can play them?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM