单个 APN 键用于一个组织中的多个应用程序 [英] Single APNs key on multiple applications in one organisation

查看:17
本文介绍了单个 APN 键用于一个组织中的多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的组织维护多个应用程序,并且对于 APNs 密钥的使用方式存在混淆.我们正在使用 firebase 发送推送通知.

My organisation maintains multiple applications and there's a confusion about how the APNs keys are supposed to be used. We are using firebase to send push notifications.

到目前为止,我们有两个苹果键用于两个不同的应用程序.但是不能在激活 APN 的情况下创建第三个密钥.

So far we have two apple keys for two different applications. But cannot create a third key with APNs activated.

这个问题表明我们应该为所有应用程序使用相同的密钥.

This question indicates that we're supposed to use the same key for all applications.

我的问题是:

如果我们只能为一个组织创建两个密钥,那么一个应该用于生产,一个用于测试/开发吗?

If we only can create two keys for one organisation is one supposed to be used for production and one for testing/development?

如果我们对多个不相关的应用程序使用相同的密钥(不相关,除了应用程序都是由同一组织创建的)什么会阻止云消息被推送到错误的应用程序.它与应用程序的标识符有关吗?我们是否应该创建一个约定来规避向错误的应用程序发送消息的问题?(我实际上并不认为这是一个非常有效的选择.感觉非常错误.)

If we use the same keys for multiple unrelated application (unrelated except that the apps are all created by the same organisation) what stops cloud messages from being pushed to the wrong application. Is it related to identifiers for apps? Are we supposed to create a convention to circumvent the problem of sending messages to the wrong app? ( I don't actually think this is a very valid option. It feels very wrong.)

例如:

  • 为每个应用使用带有前缀的主题?
  • 创建设备组,每个应用一个?

我也在这里问过这个问题:https://forums.developer.apple.com/message/415911#415911

推荐答案

该密钥用于对服务进行身份验证.它向服务标识您的组织.

The key is used to authenticate to the service. It identifies your organisation to the service.

您可以拥有两个密钥的原因是,如果密钥被泄露,您可以在撤销旧密钥之前创建一个新密钥.

The reason you can have two keys is so that you can create a new one before revoking the old one if the key is compromised.

当应用注册远程通知时,您会收到一个标识符,该标识符对于该设备上的该应用来说是唯一的.如果您在该设备上有多个应用,每个应用都会获得不同的标识符.

When an app registers for remote notifications you receive an identifier that is unique for that app on that device. If you have multiple apps on that device each will get a different identifier.

当您发送推送通知时,标识符可确保它在正确的设备上到达正确的应用程序.

When you send a push notification the identifier ensures that it gets to the right app on the right device.

您需要确保在后端存储针对正确应用的标识符(或者您可能为不同的应用使用不同的后端).

You need to ensure that you store the identifier against the right app on your backend (or you may have different backends for different apps).

这篇关于单个 APN 键用于一个组织中的多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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