3
我正在使用具有推送通知支持的IBM MobileFirst Platform Foundation 7.0創建應用。此時,iOS設備可以在應用未運行時成功接收通知。但是,如果我通過通知觸摸橫幅消息,則應用程序將啓動並立即崩潰。同樣,如果應用程序已經運行並且推送通知到達,該應用程序將立即崩潰。推送通知導致應用崩潰
奇怪的是我最初並不總是看到這種行爲。但是,現在每次都是在上述情況下發生。
我該如何解決這個問題?我需要安裝補丁嗎?我已卸載/重新安裝應用程序沒有成功。
這是我送過工作燈REST API發送短消息的有效載荷:
{
"message" : {
"alert" : "Test message",
},
"settings" : {
"apns" : {
"badge" : 1,
"iosActionKey" : "Ok",
"payload" : "",
"sound" : "song.mp3"
}
},
"target" : {
"consumerIds" : [],
"deviceIds" : [ ],
"platforms" : [ "A"],
"tagNames" : [],
},
}
這裏是我的設備錯誤報告:
> apsd[93] <Error>: Property list invalid for format: 200 (property lists cannot contain objects of type 'CFNull') [209] <Warning>:
> [DEBUG] [WL_PUSH] -[Push processRemotePushNotification:] in Push.m:426
> :: Push: didReceive Remote notification [209] <Warning>: [FATAL]
> [WORKLIGHT] Uncaught Exception: *** -[__NSArrayI objectAtIndex:]:
> index 1 beyond bounds [0 .. 0] [209] <Error>: *** Terminating app
> due to uncaught exception 'NSRangeException', reason: '***
> -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]' *** First throw call stack: (0x1863cc2d8 0x1980980e4 0x1862afb34
> 0x1002a5afc 0x1002a558c 0x1872c0180 0x18638412c 0x186383ddc
> 0x186381828 0x1862ad2d4 0x18fd036fc 0x18aeaaf40 0x1000ac0e0
> 0x198742a08) ReportCrash[210] <Error>: task_set_exception_ports(B07,
> 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument)
> ReportCrash[210] <Notice>: ReportCrash acting against PID 209
> ReportCrash[210] <Notice>: Formulating crash report for process [209]
> com.apple.xpc.launchd[1]
> (UIKitApplication:com.companyname.appname.qa[0xc100][209]) <Notice>:
> Service exited due to signal: Abort trap: 6 ReportCrash[210]
> <Notice>: Saved report to
> /var/mobile/Library/Logs/CrashReporter/_2015-08-07-231518_.ips
> SpringBoard[54] <Warning>: Application
> 'UIKitApplication:com.companyname.appname.qa[0xc100]' crashed.
尾隨目標後,並且沒有APN密鑰。 – jarryd
該文檔還列出了「actionKey」而不是「isActionKey」:http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.apiref.doc/html/refjavascript-server/html /WL.Server.html%23sendMessage –
處理推送通知負載的代碼是什麼樣的? [你可以設置所有例外的斷點](https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html#//apple_ref/doc/uid/TP40010433-CH1-SW1 )?這樣,當拋出異常時,你會知道它來自哪一行。 –