如何确定是否设备令牌是Android或iOS的? [英] How to identify if device token is for android or iOS?

查看:256
本文介绍了如何确定是否设备令牌是Android或iOS的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我保存在数据库Android和iOS设备令牌。以下是设备令牌几个例子得到保存在数据库中。

I store Android and iOS device tokens in DB. Following are few examples of device tokens getting saved in the DB.

  • 359092050465370
  • 654C4DB3-3F68-4969-8ED2-80EA16B46EB0
  • 294913EC-6100-42E8-8C2D-E9F68F286ADE

如何区分特定设备令牌是用于Android或iOS设备?

How to differentiate whether a particular device token is for an Android or iOS device?

推荐答案

我建议你随着令牌服务器发送的附加信息。例如,关于设备的令牌从注册,即Android或iOS的是什么类型的信息。一个合适的解决方案是建立登记您的令牌REST服务。如果实施该解决方案,你是对在安卓/ iOS的标记长度未来的变化面向未来。其他有用的信息存储的用户ID或类似的。

I recommend that you send additional information along with the token to the server. For example, information about what type of device the token was registered from, i.e. Android or iOS. A suitable solution is the setup a REST service for registering your tokens. If you implement this solution, you are future proof with regards to future changes in Android/iOS token length. Other useful information to store is the user id or similar.

我认为你是在谈论自己的数据库,你保存标记。

I assume that you do are talking about your own DB where you store the tokens.

这篇关于如何确定是否设备令牌是Android或iOS的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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