APN远程通知委托方法未被调用

时间:2014-10-23 15:57:17

标签: ios iphone push-notification apple-push-notifications

我们的应用设计在 iOS7 上运行。我们已经安装了 PersistentConnectionLogging 配置文件以进一步调试我们的问题(如Trouble Shooting Push Notifications technical note中所述)。

我们已确认手机通过蜂窝调制解调器提供完整有效的3G互联网连接(禁用WiFi),该应用程序允许在设置中进行远程通知,并且已成功运行在运行完全相同构建的许多其他设备上同型号手机( iPhone 4S )。该手机还受到MDM服务的监督。

正在运行的手机上,它会像这样(试图挑出有用的控制台消息),

Nov 17 11:15:14 MDM-Test-Phone-2 TestApp[546] <Warning>: >>>>>>>> APP LAUNCHED <<<<<<<<

....

Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: peer(34) received XPC_ERROR_CONNECTION_INVALID

...

Nov 17 11:15:15 calling, [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability];

...

Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: Looking up connection on peer: 15d71590  found <APSConnectionServer: 0x15db0a00>
Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]:    <APSCourier: 0x15d658d0>: Received request from <APSConnectionServer: 0x15db0a00> to generate token for topic "com.test.test" and identifier ""
Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: copyTokenForDomain sandbox.push.apple.com ,fffffff7ffffff93ffffffe039604451ffffff8cffffffccffffff80ffffffe75c0affffffe0ffffffcf5d4dffffff8cffffffa41a
Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: <APSCourier: 0x15d658d0> found cached token <c150ca2f 039dc8fb a642ac22 47d8f80b abc9d186 0811a083 a4820d99 d749c09b> for appSpecificIdentifier ,fffffff7ffffff93ffffffe039604451ffffff8cffffffccffffff80ffffffe75c0affffffe0ffffffcf5d4dffffff8cffffffa41a
Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: <APSCourier: 0x15d658d0> handleReceivedPublicToken: <c150ca2f 039dc8fb a642ac22 47d8f80b abc9d186 0811a083 a4820d99 d749c09b> forTopic com.test.test identifier 
Nov 17 11:15:15 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:15:15 -0500 apsd[82]: Dispatching low priority message: <OS_xpc_dictionary: <dictionary: 0x15dc1660> { count = 4, contents =
    "identifier" => <string: 0x15db2060> { length = 0, contents = "" }
    "message-type" => <int64: 0x15dbb460>: 21
    "topic" => <string: 0x15d9a800> { length = 22, contents = "com.test.test" }
    "token" => <data: 0x15dbd9d0>: { length = 32 bytes, contents = 0xc150ca2f039dc8fba642ac2247d8f80babc9d1860811a083... }
}>

...

didRegisterForRemoteNotificationsWithDeviceToken successfully called

...

Nov 17 11:24:41 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-11-17 11:24:41 -0500 apsd[82]: _getClientIdentity: already had identity: <SecIdentityRef: 0x15da1850>

然而,在不能正常工作的手机上,它就是这样的,

Oct 23 10:50:55 MDM-Test-Phone-2 TestApp[145] <Warning>: >>>>>>>> APP LAUNCHED <<<<<<<<
Oct 23 10:50:56 MDM-Test-Phone-3 apsd[82] <Warning>: 2014-10-23 10:50:56 -0400 apsd[82]: peer(34) received XPC_ERROR_CONNECTION_INVALID
Oct 23 10:50:56 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:50:56 -0400 apsd[82]: _getClientIdentity: already had identity: <SecIdentityRef: 0x14dbcc20>
Oct 23 10:50:56 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:50:56 -0400 apsd[82]: peer(34) received XPC_ERROR_CONNECTION_INVALID

...

Oct 23 10:50:56 calling, [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability];

...

Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: Interface manager: WWAN radio power level notification; DCH status changed to inactive
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: <APSCourier: 0x14db94b0> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to NO
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: <APSTopicManager: 0x14db9930> isPowerEfficientToSendFilter changed to NO
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: <APSCourier: 0x14d74090> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to NO
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Calculated minimum fire date [2014-10-23 16:50:34 -0400] (98.1318%) with fire date [2014-10-23 16:57:34 -0400], start date [2014-10-23 10:42:52 -0400], minimum early fire proportion 0.981318, power state detection supported: yes, in high power state: no
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:05 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:05 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Calculated minimum fire date [2014-10-23 11:24:44 -0400] (100%) with fire date [2014-10-23 11:24:44 -0400], start date [2014-10-23 10:43:51 -0400], minimum early fire proportion 0, power state detection supported: yes, in high power state: no
Oct 23 10:51:07 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:07 -0400 apsd[82] interfacemanager-wifiautoassoc: SimpleTimer <PCSimpleTimer: 0x14d72cd0> has fired
Oct 23 10:51:07 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:07 -0400 apsd[82] interfacemanager-wifiautoassoc: Invalidating simple timer <PCSimpleTimer: 0x14d72cd0>
Oct 23 10:51:07 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:07 -0400 apsd[82]: Disabling power monitoring for <PCSimpleTimer: 0x14d72cd0> - 5 timers
Oct 23 10:51:20 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:20 -0400 apsd[82] interfacemanager-wow: SimpleTimer <PCSimpleTimer: 0x14d561e0> has fired
Oct 23 10:51:20 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:20 -0400 apsd[82] interfacemanager-wow: Invalidating simple timer <PCSimpleTimer: 0x14d561e0>
Oct 23 10:51:20 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:20 -0400 apsd[82]: Disabling power monitoring for <PCSimpleTimer: 0x14d561e0> - 4 timers
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: Interface manager: WWAN radio power level notification; DCH status changed to active
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: <APSCourier: 0x14db94b0> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to YES
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: <APSTopicManager: 0x14db9930> isPowerEfficientToSendFilter changed to YES
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: <APSCourier: 0x14d74090> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to YES
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Calculated minimum fire date [2014-10-23 16:50:34 -0400] (98.1318%) with fire date [2014-10-23 16:57:34 -0400], start date [2014-10-23 10:42:52 -0400], minimum early fire proportion 0.981318, power state detection supported: yes, in high power state: yes
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:28 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:28 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Calculated minimum fire date [2014-10-23 11:24:44 -0400] (100%) with fire date [2014-10-23 11:24:44 -0400], start date [2014-10-23 10:43:51 -0400], minimum early fire proportion 0, power state detection supported: yes, in high power state: yes
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82]: Interface manager: WWAN radio power level notification; DCH status changed to inactive
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82]: <APSCourier: 0x14db94b0> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to NO
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82]: <APSTopicManager: 0x14db9930> isPowerEfficientToSendFilter changed to NO
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82]: <APSCourier: 0x14d74090> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to NO
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:36 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:36 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Calculated minimum fire date [2014-10-23 16:50:34 -0400] (98.1318%) with fire date [2014-10-23 16:57:34 -0400], start date [2014-10-23 10:42:52 -0400], minimum early fire proportion 0.981318, power state detection supported: yes, in high power state: no
Oct 23 10:51:37 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:37 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:37 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:37 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:37 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:37 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:37 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:37 -0400 apsd[82] com.apple.apsd(push.apple.com)-WWAN: <PCPersistentTimer: 0x14d5bad0> Calculated minimum fire date [2014-10-23 11:24:44 -0400] (100%) with fire date [2014-10-23 11:24:44 -0400], start date [2014-10-23 10:43:51 -0400], minimum early fire proportion 0, power state detection supported: yes, in high power state: no
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: Screen did lock (Was unlocked for 100.329434 seconds)
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: Delivering systemDidLock to <APSNetworkMonitor: 0x14d7da10>
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: <APSNetworkMonitor: 0x14d7da10> systemDidLock, refreshing state
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: Delivering systemDidLock to <APSNetworkMonitor: 0x14db95c0>
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: <APSNetworkMonitor: 0x14db95c0> systemDidLock, refreshing state
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: Delivering systemDidLock to <APSCourier: 0x14d74090>
Oct 23 10:51:55 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:55 -0400 apsd[82]: Delivering systemDidLock to <APSCourier: 0x14db94b0>
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82]: Interface manager: WWAN radio power level notification; DCH status changed to active
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82]: <APSCourier: 0x14db94b0> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to YES
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82]: <APSTopicManager: 0x14db9930> isPowerEfficientToSendFilter changed to YES
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82]: <APSCourier: 0x14d74090> <PCInterfaceMonitor: 0x14d7c5f0> interface radio hotness changed to YES
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82]: <PCInterfaceUsabilityMonitor: 0x14d44ad0> [WWAN](pdp_ip0): isInterfaceUsable? YES reachable YES linkQuality 100 isNetworkCaptive? NO
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> calculating _earlyFireDate. powerStateDetectionSupported = YES = (detectionSupported(YES) && (wwanIsUp(YES) || ! internetReachable(YES)))
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Device is plugged in, overriding earlyFireProportion to be 1.0
Oct 23 10:51:57 MDM-Test-Phone-2 apsd[82] <Warning>: 2014-10-23 10:51:57 -0400 apsd[82] com.apple.Duet.APLSScheduler: <PCPersistentTimer: 0x14dac940> Calculated minimum fire date [2014-10-23 16:50:34 -0400] (98.1318%) with fire date [2014-10-23 16:57:34 -0400], start date [2014-10-23 10:42:52 -0400], minimum early 

所以非常明确的是,在正在运行的电话上,在注册远程通知后立即触发“在对等端上查找连接”。如果在调试APN控制台消息方面具有更多专业知识的人注意到任何突出或有关于如何进行调试的建议,我很乐意听取您的意见!

1 个答案:

答案 0 :(得分:1)

我看到完全相同的问题并且有一个与背景功率使用相关的工作理论,并且可能使用beginBackgroundTaskWithExpirationHandler。 iOS可能会根据它保留的某种类型的电源使用指标来决定是否唤醒应用程序。

相关:iOS UIBackgroundMode remote-notification doesn't work on 4G

或者它只是iOS中的一个错误。绝对没有任何方式和主要皮塔病。