这是应用程序在后台的时候
当我一次发送一个推送通知时,它工作正常,应用程序处理通知,并调用completionHandler
的UAPushNotificationDelegate
。
当我一起发送两个推送通知时会发生问题(第二个是在第一个处理之前发送的)
从SDK中调用didReceiveRemoteNotification
并在SDK中处理第二个通知之前调用completionHandler
,以便我实现UAPushNotificationDelegate
方法
receivedBackgroundNotification:(UANotificationContent *)notificationContent completionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
,app崩溃抱怨EXC_BREAKPOINT (code=1, subcode=0x103b496f0)
这意味着它正试图访问已经由SDK发布的completionHandler
。
我该如何处理?
收到推送通知后,立即为completionHandler
返回receivedBackgroundNotification:(UANotificationContent *)notificationContent completionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
,并在此之后执行任务,因为iOS唤醒应用程序30秒。
这对我有用,自改变以来没有发生过这次崩溃。