【发布时间】:2016-01-31 06:51:36
【问题描述】:
当我将标签设置为 nil 时,一切正常。但是格式化标签似乎不起作用。
有什么想法吗?
func application( application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData ) {
if Leagues.count > 0 {
var myLeague: [String] = [String]()
for eachleague in Leagues {
myLeague.append(eachleague.LeagueName)
}
let categories: NSSet = NSSet(array: myLeague)
let hub : SBNotificationHub = SBNotificationHub(connectionString: "Endpoint=<my endpoint>", notificationHubPath: "<myhub>")
hub.registerNativeWithDeviceToken(deviceToken, tags: categories as! Set<NSObject>) { (error) -> Void in
if (error != nil){
print("Error registering for notifications: %@", error);
}
}
}
}
我正在尝试在 Objective-c 中遵循这个示例:https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-ios-send-breaking-news/
【问题讨论】:
-
我不确定我是否找到了解决方案 - 但我了解到其中带有空格的标签似乎被阻塞了。可能是这里的问题。
标签: swift apple-push-notifications azure-notificationhub