在 Android 应用程序用户之间共享令牌(数据)
我想知道是否有人有一个简单的解决方案,使我的应用程序的用户可以与他们的朋友共享应用程序为他们生成的令牌?
假设两个人安装该应用程序,我希望一个人能够与另一用户共享他们的令牌。
我研究过 Facebook,登录/好友系统会很完美,但是我找不到轻松共享令牌的方法。
显然,用户可以通过电子邮件将此令牌互相发送,但这不会是一个很好的用户体验。
有任何建议欢迎提出
I was wondering if anyone had a simple solution for which users of my application can share a token that the application generates for them with their friends?
Say two people install the application, I would like one person to be able to share their token with another user.
I have looked into Facebook, and the Login/Friends system would be perfect, however I cannot see a way to share the token easily.
Obviously users could email this token to each other, but that would not be a great user experience.
Any suggestions are welcome
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不在后端服务器上共享令牌?然后,用户只需向服务器发送请求,服务器就可以通过推送通知或经常轮询服务器是否有新的令牌请求来管理共享。这也是一种更可靠的方法,因为如果用户切换到新手机(或卸载应用程序然后重新安装),则再次获取所有令牌将是微不足道的。
除此之外,我能看到的最简单的方法是让用户通过短信或电子邮件发送令牌。同样,这并不是一个很好的解决方案,但相对简单,并且需要的工作量会少很多。
Why not have the token sharing on a backend server? Then users can just send requests to the server and the server can manage the sharing, either through push notifications or by polling the server for new token requests every so often. This is also a more robust way to do it, since if a user switches to a new phone (or uninstalls the app and then reinstalls), it would be trivial to get all the tokens again.
Other than that the simplest way I could see would be to let the users text or email the tokens. Again, not really a great solution, but relatively simple and it will take a lot less work.
您可以向朋友发送特殊格式的短信。然后,您的应用程序会拦截短信并在用户看不到的情况下对其进行处理。当然,您需要适当的权限。
You could send a specially formatted SMS to the friend. Your app would then intercept the SMS and process it without the user seeing it. You'd need the proper permissions, of course.