Wednesday, 15 February 2012

Windows Azure iOS Push Notifications Error -



Windows Azure iOS Push Notifications Error -

am trying utilize windows azure force notifications ios, android etc.

on ios have next code create , register windows azure.

- (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *) devicetoken { nsstring * connectionstring = [sbconnectionstring stringwithendpoint: [nsurl urlwithstring: @"https://aa-ns.servicebus.windows.net/"] listenaccesssecret:@"bbbbb"]; sbnotificationhub*hub = [[sbnotificationhub alloc] initwithconnectionstring: connectionstring notificationhubpath:@"aa"]; [hub registernativewithdevicetoken:devicetoken tags:nil completion:^(nserror* error) { if (error != nil) { nslog(@"error registering notifications: %@", error); } else { nslog(@"register successful"); } }]; }

when run on device error below not sure causing this:

error registering notifications: error domain=windowsazuremessaging code=-1 "initiate request failed { url: https://aa-ns.servicebus.windows.net/bb/registrations/2131816658076175975-431628186293699175-5?api-version=2013-04, headers: { authorization = "sharedaccesssignature sr=http%3a%2f%aa-ns.servicebus.windows.net%aa%2fregistrations%2f2131816658076175975-431628186293699175-5%3fapi-version%3d2013-04&sig=yw6mdy6rbpgwhi9ninuv2zz4cbai6tcc91nglg%2fjt%2b4%3d&se=1413280889&skn=defaultlistensharedaccesssignature"; "content-type" = "application/xml"; "user-agent" = "notificationhubs/2013-04(api-origin=iossdk; os=iphone os; os_version=8.0.2;)"; } }" userinfo=0x16014600 {nslocalizeddescription=initiate request failed { url: https://aa-ns.servicebus.windows.net/bb/registrations/2131816658076175975-431628186293699175-5?api-version=2013-04, headers: { authorization = "sharedaccesssignature sr=http%3a%2f%aa-ns.servicebus.windows.net%aa%2fregistrations%2f2131816658076175975-431628186293699175-5%3fapi-version%3d2013-04&sig=yw6mdy6rbpgwhi9ninuv2zz4cbai6tcc91nglg%2fjt%2b4%3d&se=1413280889&skn=defaultlistensharedaccesssignature"; "content-type" = "application/xml"; "user-agent" = "notificationhubs/2013-04(api-origin=iossdk; os=iphone os; os_version=8.0.2;)"; } }}

(i removed reference application name)

please help. thanks

make sure have latest windowsazuremessaging.framework (available here: https://go.microsoft.com/fwlink/p/?linkid=266533) , seek changing code this:

sbnotificationhub *hub = [[sbnotificationhub alloc] initwithconnectionstring: @"notificationhublistensharedaccesssignature" notificationhubpath:@"notificationhubname"];

replace 2 parameters values hub. create sure hubname name of notification hub , not service bus namespace.

ios azure-mobile-services

No comments:

Post a Comment