如何确定是否设备令牌是Android或iOS的?令牌、设备、iOS、Android

2023-09-14 00:03:13 作者:男宠

我保存在数据库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.