當我將標籤設置爲零時,它的效果都很好。但格式化標籤似乎不起作用。標籤在Swift中無法在通知中心工作
任何想法?
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/
我不知道如果我找到解決辦法 - 但我也認識到,在他們的空間標籤似乎被阻塞。可能是這裏的問題。 – Davemen