Azure / azure-notificationhubs-samples

Microsoft Azure Notification Hubs Samples
Apache License 2.0
162 stars 240 forks source link

Cant register phone to the notifications hub server #47

Closed alioriyadho closed 5 years ago

alioriyadho commented 7 years ago

Im getting this issue when run this code:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:HUBFULLACCESS notificationHubPath:HUBNAME];
        [hub unregisterAllWithDeviceToken:deviceToken completion:^(NSError* error){
            dispatch_async(dispatch_get_main_queue(), ^{
                [hub registerNativeWithDeviceToken:deviceToken tags:tags completion:^(NSError* error) {
                    if (error != nil) {
                        NSLog(@"Error registering for notifications: %@", error);
                    } else {
                        NSLog(@"Registerd for notification");
                    }
                }];
            });
        }];
    });

Here is the error:

Error Domain=WindowsAzureMessaging Code=400 "URLRequest failed for <NSMutableURLRequest: 0x170013f20> { URL: https://<HubName>.servicebus.windows.net/<HubName>/Registrations/2044525541292942848-4457854038111768645-1?api-version=2013-04 } with status code: bad request" UserInfo={NSLocalizedDescription=URLRequest failed for <NSMutableURLRequest: 0x170013f20> { URL: https://<HubName>.servicebus.windows.net/<HubName>/Registrations/2044525541292942848-4457854038111768645-1?api-version=2013-04 } with status code: bad request}
jwargo commented 5 years ago

Which sample are you working with?

jwargo commented 5 years ago

@alioriyadho do you still need help with this issue?

jwargo commented 5 years ago

No response so I'm closing this.