Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

消息ID与对应设备类型 #212

Open
su-chang opened this issue Feb 16, 2022 · 0 comments
Open

消息ID与对应设备类型 #212

su-chang opened this issue Feb 16, 2022 · 0 comments
Labels
question Further information is requested

Comments

@su-chang
Copy link
Member

su-chang commented Feb 16, 2022

案例

"3AF7EC9A6A423B11E6F3"
"3EB08BC039A8F4173A55"
"4E5F598CCC63017C6780BE5B70701C72"

根据长度及前两个字符进行区分

  • 20

    • 3A开头

      iOS

    • 其他

      Web

  • 32

    Android

源码

/**
 * String that represents from which device type the message was sent
 * @type {string}
 */
  this.deviceType = data.id.id.length > 21 ? 'android' : data.id.id.substring(0,2) =='3A' ? 'ios' : 'web';
@su-chang su-chang added the question Further information is requested label Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant