苹果推送通知一个应用多个子域
Apple push notification one app more subdomains
当我连接到 sub1.domain.com
时如何设置苹果推送通知我的服务器将发送消息给 APP_ID
,而当连接到 sub2.domain.com
时我将只从那个接收消息子域名。
就像在 GCM 中一样,我有 5 个应用程序用于 5 个子域,我的 ios 应用程序连接到另一个 app_id 并获取该应用程序(子域)的令牌。
在苹果推送通知中可以吗?
iOS 远程推送通知只是请求一个设备令牌,而 APNs 只是通过设备令牌向设备发送消息。设备令牌对 iDevice 来说是唯一的。
为了您的目的,您可以将设备令牌和 "token channel" 保存到数据库中,例如INSERT INTO device_tokens (channel, token) VALUES ('subdomain1', 'xxxxxxxxx')
,发送消息时,使用通道排队设备令牌,例如SELECT token FROM device_tokens WHERE channel = 'subdomain1'
当我连接到 sub1.domain.com
时如何设置苹果推送通知我的服务器将发送消息给 APP_ID
,而当连接到 sub2.domain.com
时我将只从那个接收消息子域名。
就像在 GCM 中一样,我有 5 个应用程序用于 5 个子域,我的 ios 应用程序连接到另一个 app_id 并获取该应用程序(子域)的令牌。
在苹果推送通知中可以吗?
iOS 远程推送通知只是请求一个设备令牌,而 APNs 只是通过设备令牌向设备发送消息。设备令牌对 iDevice 来说是唯一的。
为了您的目的,您可以将设备令牌和 "token channel" 保存到数据库中,例如INSERT INTO device_tokens (channel, token) VALUES ('subdomain1', 'xxxxxxxxx')
,发送消息时,使用通道排队设备令牌,例如SELECT token FROM device_tokens WHERE channel = 'subdomain1'