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

时间:2015-09-03 21:37:18

标签: ios .net push-notification apple-push-notifications azure-mobile-services

您出于某种原因一直遇到重大问题而且无法解决原因。

我正在注册设备注册:

- (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   } {status code:200,headers {“Cache-Control”=“no-cache”;   “Content-Encoding”= gzip; “内容长度”= 483; “内容类型”=   “application / json; charset = utf-8”;日期=“星期四,2015年9月3日21:11:01   GMT“; Expires = 0; Pragma =”no-cache“; Server =”Microsoft-IIS / 8.0“;   “Set-Cookie”=   “ARRAffinity = 6400fd48b4ba8e8bea4813afbd16c1ff61bacfd0d259c7c36e529f742a8de958;路径= /;域= hiddenAppName-mobile-app.azure-mobile.net”;   Vary =“Accept-Encoding”; “X-Powered-By”=“ASP.NET”; }}

,数据是:

  

[{ “平台”: “APNS”, “设备ID”: “0F165A3BD554E4F4FCB8E412B537F2FE10B08FE1E2D1C168AE9EBE8A6DC15CA9”, “registrationId”: “3293417219461121655-5315545091225715647-20”, “标签”:[ “CCE40A1696B14DADA2F005D554F970F6”], “TEMPLATENAME”:NULL,” templateBody “:空,” 报头 “:{},” 过期 “:” 2015-11-14T22:29:07.896Z “},{” 平台 “:” APNS”, “设备ID”: “0F165A3BD554E4F4FCB8E412B537F2FE10B08FE1E2D1C168AE9EBE8A6DC15CA9”, “registrationId” : “6230917652908957715-607108047627745508-20”, “标签”:[ “13E1958EDF1D43AD8B5D9F61CF1203C8”], “TEMPLATENAME”:NULL, “templateBody”:空, “报头”:{}, “过期”:“2015-11-17T20:58 :32.505Z“}]

当从filterResponse方法(上面)调用onResponse回调时,应用程序在[MSLocalStorage commitDefaultsWithStorageVersion]中崩溃了一些调用 有这个错误:

  

属性列表格式无效:200(属性列表词典可能   只有CFS字符串的键,而不是'CFNull')2015-09-03   22:18:58.778 hiddenAppName [2399:1160388]尝试设置一个   非属性列表对象{“”=   “6230917652908957715-607108047627745508-20”;作为一个   NSUserDefaults / CFPreferences值为key   hiddenAppName-mobile-app.azure-mobile.net-registrations 2015-09-03   22:18:58.779 hiddenAppName [2399:1160388] *由于终止应用程序   未捕获的异常'NSInvalidArgumentException',原因:'尝试   插入非属性列表对象{“”=   “6230917652908957715-607108047627745508-20”;为了钥匙   hiddenAppName-移动app.azure-mobile.net的登记   * 首先抛出调用堆栈:

     

(0x1829e022c 0x1946ac0e4 0x1829e016c 0x182a19fb4 0x18296c870   0x18296b850 0x182a1a2b0 0x182a19848 0x182a1d0d8 0x18380a960   0x10012ec00 0x10012e748 0x10011b78c 0x100121474 0x10007bce4   0x10007b734 0x10011ee7c 0x18245d1e8 0x18245d178 0x18245d2f4   0x18232fdfc 0x1823fa120 0x18231befc 0x1828c097c 0x18231bda8   0x18231bc5c 0x18231ba88 0x182997f8c 0x182997230 0x1829952e0   0x1828c0f74 0x18c31b6fc 0x1874c2d94 0x10001762c 0x194d56a08)

     

libc ++ abi.dylib:以未捕获的类型异常终止   NSException

为什么这是任何人的任何想法?

1 个答案:

答案 0 :(得分:0)

处理空模板名称存在一个错误,现在已在2.2.1中修复。如果你更新到那个版本,你应该很高兴。 (修复:https://github.com/Azure/azure-mobile-services/commit/9347390

相关问题