Firebase实例ID和令牌的范围 [英] The scope of Firebase Instance Id and Token

查看:83
本文介绍了Firebase实例ID和令牌的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了许多有关Firebase Instance Idregistration token的文章此处此处

I've read a lot of articles about Firebase Instance Id and registration token here, here and here.

我对他们在Instance IdToken之间的范围和关系感到困惑.我想验证我的理解是正确还是错误.

I have some confusions about their scope and relationship between Instance Id and Token. I would like to validate that my understandings are correct or wrong.

    每个应用生成
  1. Instance Id.不是每个已安装的设备.例如,如果您具有邮件应用程序和Notes应用程序,则Firebase上将具有两个实例ID.
  2. 每个安装的设备都会生成
  3. Token.例如,如果您有个用户安装您的应用,则您将有个注册令牌.
  4. 一个Instance Id将具有许多注册令牌.
  5. 通常,我们只需在App Server上保留registration tokens(而不是实例ID)即可发送推送通知.
  1. Instance Id is generated per App. Not per installed device. For example, if you have Mail app and Notes App, you will have two Instance Id on firebase.
  2. Token is generated per installed devices. For example, if you have ten users installing your app, you will have ten registration tokens.
  3. One Instance Id will have many registration tokens.
  4. Normally, we only have to keep registration tokens (not Instance Id) on our App Server to send push notifications.

推荐答案

  1. 部分正确. InstanceID与应用程序实例有关.在您的示例中,如果您有Mail App和Notes App,则每个都有其自己的 instance id,但是两者并不相同,因此无法将它们分组在一起.

  1. Partly correct. An InstanceID pertains to the app instance. In your example, if you have the Mail App and the Notes App, each has their own instance id, but the two are not the same, so they can't be grouped together.

将应用程序实例视为应用程序安装.如果您已在设备上安装了该应用程序,则该应用程序具有该应用程序实例.如果您卸载它,它也会被删除,如果您重新安装它,它是一个新应用实例.

Think of the app instance as the app installation. If you have installed the app on the device, it has the app instance. If you uninstall it, it is also removed, if you re-install it, it's a new app instance.

正确.但这也可能为同一设备使用多个令牌,但这仅与多个发件人有关.

Correct. But there's also a possibility to have multiple tokens for the same device, but this only pertains to having multiple senders.

可能.参见#2.

是的.注册令牌是作为推送通知目标所需的值.

Yes. The registration token is the value needed as a target for push notifications.

这篇关于Firebase实例ID和令牌的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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