【发布时间】:2016-12-31 12:12:28
【问题描述】:
我需要 Azure 的registrationId。是否可以从 Azure 获取registrationId?
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken {
SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:HUBLISTENACCESS
notificationHubPath:HUBNAME];
[hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) {
if (error != nil) {
NSLog(@"Error registering for notifications: %@", error);
}
else {
[self MessageBox:@"Registration Status" message:@"Registered"];
}
}];
}
通知工作正常,但我需要 Azure 的registrationId 发送回服务器。
【问题讨论】:
-
你能解决这个问题吗?我面临同样的问题。我想将 RegistrationId 发送回后端,但我只是获得了 Apple Token。
-
有没有人能拿到注册ID?
-
我仔细研究了github.com/Azure/azure-notificationhubs/tree/master/iOS/… 提供的 NotificationHub SDK 代码,发现注册方法都是 SDK 类 SBNotificationHub 内部的,并没有通过 ObjC 头文件公开。在他们这样做之前,你要么用自己的覆盖 SDK 头文件,要么接受你不能拥有它。
标签: ios azure apple-push-notifications azure-notificationhub