小编Pav*_*rra的帖子

如何从iOS中的Azure notificationhub获取registrationId

我需要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"];
        }
    }];
}
Run Code Online (Sandbox Code Playgroud)

通知工作正常,但我需要Azure中的registrationId发送回服务器.

azure apple-push-notifications ios azure-notificationhub

5
推荐指数
1
解决办法
346
查看次数