Azure notification hubs - how to set multiple apps

2019-02-11 01:02发布

问题:

I have a situation where I need to use the same notification hub for several iOS applications. For a given tag - all the applications should receive this push.

Each iOS app has a different push notification certificate, so only one of the apps actually got the push notification. I don't want to resolve to opening multiple hubs - because then I need to manage which hub each app could belong to - and this is very awkward.

How can I achieve this?

回答1:

I'm pretty certain what you want to do is impossible for several reasons. iOS push is handled via APNS which is an Apple technology. Apple dictates that every individual app has to have it's own bundle identifier and therefore it's own specific push certificate. Notification Hubs doesn't support multiple certificates (or multiple app settings for any of the push providers) so there is no way for an individual hub to push to more than one app. You're stuck having some sort of management layer built which knows which hub to talk to for which app. Alternatively, you could just ask all of your hubs to send the same message and use Tags to do the actual filtering (each hub is asked to send a message but only the hub with a device registered with the right tag does).