Azure移动服务PushNotifications设备注册

时间:2015-05-08 11:16:11

标签: azure push-notification azure-mobile-services

我正在构建基于AzureMobileServices的应用程序。但我遇到了以下问题。

由于某些原因,我需要每个AzureMobileService应用程序使用少量集线器(它将被少数iOS应用程序使用,因此需要使用不同的APNS证书)。

我已经通过必要的集线器实现了发送通知的逻辑,但设备注册继续使用来自web.config的连接字符串。

是否有办法处理设备注册过程以使设备注册必要的集线器?

1 个答案:

答案 0 :(得分:2)

直接通过Notification Hub支持多租户,因此客户端需要在执行操作时直接连接到各个集线器。如果设备注册使用相同的连接字符串,则可能是您正在使用移动服务(移动应用程序)推送客户端。你介意检查吗?

get started iOS tutorial有一个可以提供帮助的代码段:

SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:
                          @"<connection string>" notificationHubPath:@"mynh"];

[hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) {
    if (error != nil) {
        NSLog(@"Error registering for notifications: %@", error);
    }
}];