Android - 如何从多个设备检测同一用户? [英] Android - How to detect same user from multiple devices?

查看:35
本文介绍了Android - 如何从多个设备检测同一用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将用户创建的数据发送到服务器的应用程序.

I am developing an app that sends user-created data to a server.

当他在不同设备上使用该应用时,是否可以识别同一用户我的应用不必请求访问他的 Google 帐户、需要额外权限或要求他创建自定义登录凭据?(这很重要,因为我的应用需要为匿名"用户工作.)

Is it possible to recognise the same user when he is using the app on different devices without my app having to request access to his Google account, requiring additional permissions or asking him to create custom login credentials? (This is important as my app needs to work for 'anonymous' users.)

我的应用程序使用推送通知,对于任何给定用户,我了解 FireBase 生成的令牌 ID 可能对于他的每个设备安装的应用程序都是相同的.因此,我正在考虑使用这些令牌 ID 来跨多个设备识别同一用户.但是,我不确定这种方法有多可靠 - 或者是否有更好的方法?

My app uses push notifications and, for any given user, I understand that the token ID generated by FireBase may be the same for each of his device installations of the app. So I am considering using these token IDs to identify the same user across multiple devices. However, I'm not sure how reliable that approach would be - or if there is a better way?

注意 - 我发现 唯一标识符的最佳做法(特别是 处理多个安装部分),但它没有帮助.

NB - I found Best Practices for Unique Identifiers (the Handling Multiple Installations section in particular), but it hasn't helped.

推荐答案

我们可以用同一个账号管理多个安装,

We can manage multiple installation with same account,

  1. 使用 firebase 生成设备令牌
  2. 在本地和服务器上存储令牌
  3. 在初始屏幕上始终检查存储在本地的令牌和存储在服务器上的令牌
  4. 如果显示差异,请用户仅保持一台设备处于活动状态以接收通知,如果用户选择当前设备将该令牌存储到服务器.

这篇关于Android - 如何从多个设备检测同一用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆