0

嗨香港專業教育學院一直與這個重大問題因某種原因不能和工作原因。APNS設備註冊蔚藍的移動服務IOS

林登記爲設備註冊:

- (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; "Content-Length" = 483; "Content-Type" = "application/json; charset=utf-8"; Date = "Thu, 03 Sep 2015 21:11:01 GMT"; Expires = 0; Pragma = "no-cache"; Server = "Microsoft-IIS/8.0"; "Set-Cookie" = "ARRAffinity=6400fd48b4ba8e8bea4813afbd16c1ff61bacfd0d259c7c36e529f742a8de958;Path=/;Domain=hiddenAppName-mobile-app.azure-mobile.net"; Vary = "Accept-Encoding"; "X-Powered-By" = "ASP.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); 
} 
}]; 
} 
在濾波器響應的方法,看起來像這樣

數據爲:

[{"platform":"apns","deviceId":"0F165A3BD554E4F4FCB8E412B537F2FE10B08FE1E2D1C168AE9EBE8A6DC15CA9","registrationId":"3293417219461121655-5315545091225715647-20","tags":["CCE40A1696B14DADA2F005D554F970F6"],"templateName":null,"templateBody":null,"headers":{},"expiration":"2015-11-14T22:29:07.896Z"},{"platform":"apns","deviceId":"0F165A3BD554E4F4FCB8E412B537F2FE10B08FE1E2D1C168AE9EBE8A6DC15CA9","registrationId":"6230917652908957715-607108047627745508-20","tags":["13E1958EDF1D43AD8B5D9F61CF1203C8"],"templateName":null,"templateBody":null,"headers":{},"expiration":"2015-11-17T20:58:32.505Z"}]

當onResponse回調從該filterResponse方法(上圖)的應用程序崩潰了幾個電話下來[MSLocalStorage commitDefaultsWithStorageVersion] 與此錯誤稱爲:

Property list invalid for format: 200 (property list dictionaries may only have keys which are CFStrings, not 'CFNull') 2015-09-03 22:18:58.778 hiddenAppName[2399:1160388] Attempt to set a non-property-list object { "" = "6230917652908957715-607108047627745508-20"; } as an NSUserDefaults/CFPreferences value for key hiddenAppName-mobile-app.azure-mobile.net-registrations 2015-09-03 22:18:58.779 hiddenAppName[2399:1160388] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object { "" = "6230917652908957715-607108047627745508-20"; } for key hiddenAppName-mobile-app.azure-mobile.net-registrations' * First throw call stack:

(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: terminating with uncaught exception of type NSException

任何想法,爲什麼這是任何人嗎?

回答

0

處理空模板名稱時出現了一個錯誤,現在已經在2.2.1中解決了這個問題。如果你更新到該版本,你應該很好去。 (FIX:https://github.com/Azure/azure-mobile-services/commit/9347390

+0

你好非常感謝你爲你的答覆!由於改變它已停止崩潰,但現在我沒有收到推送通知。我在服務器上有一個生產證書(我試過沙盒和開發證書),並註冊設備(事件雖然一次推後消失)移動服務表示消息發送給apns,但它永遠不會到達了。除了升級之外,還有更多嗎?它是否應該發回模板?我認爲在某些時候我收到了模板,因爲它在三天或四天內沒有崩潰,然後突然開始。 – user3364602

+0

它可能是一個證書問題我要一步一步地經歷整個過程,但我不明白是什麼改變.....它非常令人沮喪 – user3364602