问题
I have an app that uses pushkit (voip push). Most of the time the pushes get through. But when there is a lot of traffic, the pushes don't get through to the app. I am in a state where I can somehow reproduce the error.
I used the extended logging from here: https://developer.apple.com/library/ios/technotes/tn2265/_index.html
And I found this to examine the logging: http://iosdevelopertips.com/core-services/debug-failed-push-messages-by-logging-apsd-process.html
Still, I got two different cases, where I just don't get further: - In the apsd-log I get
Received message for enabled topic ...
and in the app the didReceiveIncomingPushWithPayload is not called. I produce a log entry right at the start of the function and do nothing special that could prevent the function from finishing. - In the apsd-log I get
Stream error occurred ...
but do not find any other error messages, why this error occurs. The Port seems ok
After restarting the app the pushes get through again.
EDIT:
The relevant error in the log file seems to be:
apsd[82]: Failed sending message to client: com.apple.telephonyutilities.callservicesdaemon.voip.push.development
There seems to be two types of cases: In some cases, which are reproducable with large traffic, reregistering the pushkit seems to help.
In other cases, which occur random, it simply does not. Restarting the app does not help here either. All helps so far, is restarting the iphone.
EDIT:
I am still struggling with this problem. In some cases I get a memory warning before the push seems to fail. In other cases I get a xpc communication warning like this:
SpringBoard[43] <Warning>: Communications error: <OS_xpc_error: <error: 0x3b7ef614> { count = 1, contents =
"XPCErrorDescription" => <string: 0x3b7ef86c> { length = 22, contents = "Connection interrupted" }
}>
In some cases none of the above happens, but push still does not work.
EDIT: In developer archive I found this very interesting thread, but still no answer: https://devforums.apple.com/thread/257354?start=50&tstart=0
Does anybody know if there is a connection between xpc and push? And is there a way to detect a xpc error in code?
来源:https://stackoverflow.com/questions/32694731/apple-push-didreceiveincomingpushwithpayload-not-called-instead-error-faile