Apns设备注册azure移动服务ios与.net后端错误



由于某些原因,我一直有很大的问题,不知道为什么。

我注册设备注册:

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
MSClient *client = self.authService.client;
[client.push registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError *error) {
if (error != nil) {
NSLog(@"Error registering for notifications: %@", error);
}
}];
}

中的过滤器响应方法,看起来像这样:

- (void) filterResponse: (NSHTTPURLResponse *) response
                forData: (NSData *) data
              withError: (NSError *) error
             forRequest:(NSURLRequest *) request
                 onNext:(MSFilterNextBlock) onNext
             onResponse: (MSFilterResponseBlock) onResponse{
 **code omitted **
}

我得到返回的响应:

{URL:https://hiddenAppName-mobile-app.azure-mobile.net/push/registrations%3FdeviceId=0F165A3BD554E4F4FCB8E412B537F2FE10B08FE1E2D1C168AE9EBE8A6DC15CA9&platform=apns}{状态码:200,报头{"Cache-Control" = "no-cache";"Content-Encoding" = gzip;"Content-Length" = 483;"内容类型"="application/json;charset = utf - 8";日期="2015年9月3日星期四21:11:01"格林尼治时间";过期= 0;Pragma = "no-cache";Server = "Microsoft-IIS/8.0";"set - cookie"="ARRAffinity = 6400 fd48b4ba8e8bea4813afbd16c1ff61bacfd0d259c7c36e529f742a8de958;路径=/域= hiddenAppName-mobile-app.azure-mobile.net";Vary = "Accept-Encoding";"X-Powered-By" = "ASP.NET";}}

,数据为:

[{"平台":"导引"、"的deviceId":"0 f165a3bd554e4f4fcb8e412b537f2fe10b08fe1e2d1c168ae9ebe8a6dc15ca9"、"registrationId":"3293417219461121655-5315545091225715647-20"、"标签":"CCE40A1696B14DADA2F005D554F970F6","templateName":空,"templateBody":空,"标题":{},"过期":"2015 - 11 - 14 - t22:29:07.896z"},{"平台":"导引"、"的deviceId":"0 f165a3bd554e4f4fcb8e412b537f2fe10b08fe1e2d1c168ae9ebe8a6dc15ca9"、"registrationId":"6230917652908957715-607108047627745508-20"、"标签":[" 13 e1958edf1d43ad8b5d9f61cf1203c8"),"templateName":空,"templateBody":空,"头":{},"过期":"2015 - 11 - 17 t20:58:32.505z"}]

当从上面的filterResponse方法调用onResponse回调时,应用程序在[MSLocalStorage commitDefaultsWithStorageVersion]中崩溃了几个调用出现以下错误:

属性列表无效的格式:200(属性列表字典可能只使用cfstring,而不是'CFNull') 2015-09-0322:18:58.778 hiddenAppName[2399:1160388]尝试设置非属性列表对象{" ="6230917652908957715-607108047627745508-20";}作为一个NSUserDefaults/CFPreferences中键的值hiddenAppName-mobile-app.azure-mobile.net-registrations 2015-09-0322:18:58.779 hiddenAppName[2399:1160388] *由于未捕获的异常'NSInvalidArgumentException',原因:'尝试插入非属性列表对象{" ="6230917652908957715-607108047627745508-20";} for keyhiddenAppName-mobile-app.azure-mobile.net-registrations"*第一个抛出调用栈:

(0x1829e022c 0x1946ac0e4 0x1829e016c 0x182a19fb4 0x18296c870。0x18296b850 0x182a1a2b0 0x182a19848 0x182a1d0d8 0x18380a9600x10012ec00 0x10012e748 0x10011b78c 0x100121474 0x10007bce40x10007b734 0x10011ee7c 0x18245d1e8 0x18245d178 0x18245d2f40x18232fdfc 0x1823fa120 0x18231befc 0x1828c097c 0x18231bda80x18231bc5c 0x18231ba88 0x182997f8c 0x182997230 0x1829952e00x1828c0f74 0x18c31b6fc 0x1874c2d94 0x10001762c 0x194d56a08

libc + + abi。以未捕获的类型异常结束NSException

知道为什么这是任何人吗?

有一个处理空模板名的错误,现在在2.2.1中修复了。如果你升级到那个版本,你就可以了。(解决办法:https://github.com/Azure/azure-mobile-services/commit/9347390)

最新更新