Azure 通知中心能否在一个请求中同时在 SANDBOX 和 PRODUCTION 中发送推送通知?

Can Azure Notification Hubs send a push notification in both SANDBOX and PRODUCTION in one request?

我正在使用 Azure 通知中心作为向移动设备发送推送通知的服务。

我开发了一个简单的节点服务器来注册和发送推送通知。

我已经完成了推送通知的实施,移动客户端现在可以从我的服务器接收推送,但特别适用于 SANDBOX 和 PRODUCTION。

有没有一种方法可以让我的服务器在一个请求中同时在 SANDBOX 和 PRODUCTION 中发送推送通知?

这是我在 SANDBOX/PRODUCTION

中发送推送通知的代码
var payLoad = {
        aps: {
            alert: data
        }
    };
    azure.apns.send(tag, payLoad, function (err, reps){
        if(!err){
            cb({error: false});
        }else{
            cb({error: true, error_log: err});
        }
    })

没有理由这样做。这是两个有意分开和隔离的环境。

这里 an older blog post 概述了关于这两者的基本事实:

General Rule of Thumbs:

Keep in mind that the sandbox (development) environment is entirely separate to the production environment. Let me repeat: Keep in mind that the sandbox (development) environment is entirely separate to the production environment. Mixing device tokens and certifications across the environment will lead to a lot of nothing (that is, non responses). Servers needs push certificates from the provisioning portal. Clients register themselves with push services by communicating with Apple servers. The two environments have items needed specific to them. More specifically:

Servers need a separate developer certificate and production certificate. Client get a different device token when registering themselves in development builds vs applications downloaded from the App Store. Therefore, the following rules exist (unless you do some hackery I’m not currently aware of):

Development builds of your client (that is, any build put on your device from the development environment including Ad Hoc) will get development device tokens when registering with the APNS. Which means you can’t test production server settings with at development build on your client. Attempts to do so will lead to confusion and wasted time. Production builds (that is, the app actually downloaded from the App Store) will get production device tokens. These must be tested with production APNS server settings.