Monday, 15 March 2010

ios - Native registration to Azure hub always crashes the first time the app is launched -



ios - Native registration to Azure hub always crashes the first time the app is launched -

i've made ios 7.0 app utilize push-notifications , azure mobile services framework. good, i've seen when clear app (e.g., remove phone forcefulness "first launch" use-case), app crashes assume bug/crash within azure framework?

basically, i'm running next code-snippet;

//proceed , register sbnotificationhub* hub = [[sbnotificationhub alloc] initwithconnectionstring:notificationconnectionstring notificationhubpath:notificationhub]; ddloginfo(@"hub object = %@", hub); //register native hub... nserror* error = nil; if (![hub registernativewithdevicetoken:devicetoken tags:nil error:&error]) { //false ddloginfo(@"failed register native hub..."); if (error) ddlogerror(@"found error; %@", error.localizeddescription); }

... , when registernativewithdevicetoken: executed, app crashes next exception;

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** setobjectforkey: key cannot nil'

enabling breakpoint exceptions show next trace, indicating it's sblocalstorage class, part of azure framework, seek set nil in nsdictionary;

thread 4, queue : nsmanagedobjectcontext queue #0 0x3bc7e1f0 in __pthread_kill () #9 0x30e6e1be in -[__nsdictionarym setobject:forkey:] () #10 0x0022afa8 in -[sblocalstorage updatewithregistrationname:registration:] @ /users/admin/desktop/main/enlist/windowsazuremessaging/windowsazuremessaging/helpers/sblocalstorage.m:89 #11 0x0022ae4c in -[sblocalstorage updatewithregistration:] @ /users/admin/desktop/main/enlist/windowsazuremessaging/windowsazuremessaging/helpers/sblocalstorage.m:70 #12 0x00227d76 in -[sbnotificationhub retrieveallregistrationswithdevicetoken:error:] @ /users/admin/desktop/main/enlist/windowsazuremessaging/windowsazuremessaging/sbnotificationhub.m:700 #13 0x00227202 in -[sbnotificationhub registernativewithdevicetoken:tags:error:] @ /users/admin/desktop/main/enlist/windowsazuremessaging/windowsazuremessaging/sbnotificationhub.m:458 #14 0x000b6788 in -[backendcommunicator registerpushnotificationsfordevicetoken:] @ /users/markus/xcode/myapp/myapp/backendcommunicator.m:1632

but, regardless, has else seen this? , moreover, why work consecutive launches, not first?

best, /markus

i tried reproduce issue described, me sdk works ok @ scenario. found , fixed serious bug.

latest version available on git hub, i've uploaded ready-to-use binaries convenience: https://github.com/azure/azure-notificationhubs/tree/master/ios/bin.

so suggest seek if works after lastly fixes.

ios apple-push-notifications azure-mobile-services

No comments:

Post a Comment