我正在为 ios 使用 Windows azure 服务总线通知中心
我通过以下代码注册我的设备:
SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:
@"Endpoint=sb://......" notificationHubPath:@"...."];
NSMutableSet *set = [NSMutableSet set];
[set addObject:@"general"];
[hub registerNativeWithDeviceToken:deviceToken tags:[set copy] completion:^(NSError* error) {
if (error != nil) {
NSLog(@"Error registering for notifications: %@", error);
[self.delegate homePopUpViewControllerEnterButtonPress:self];
}
}];
并使用以下代码从 .Net 后端发送通知:
var hubClient = NotificationHubClient.CreateClientFromConnectionString(<connection string>, "<notification hub name>");
IDictionary<string, string> properties = new Dictionary<string, string>();
properties.Add("badge", "1");
properties.Add("alert", "This is Test Text");
properties.Add("sound", "bingbong.aiff");
hubClient.SendTemplateNotification(properties, "general");
我能够收到通知,但我的问题是:通知没有我添加的任何属性,没有声音,没有徽章......
如果可以请帮助我
参考资料:http: //msdn.microsoft.com/en-US/library/jj927168.aspx
谢谢