iOS - Urban Airship - 处理多个背景远程通知

问题描述 投票:1回答:1

这是应用程序在后台的时候

当我一次发送一个推送通知时,它工作正常,应用程序处理通知,并调用completionHandlerUAPushNotificationDelegate

当我一起发送两个推送通知时会发生问题(第二个是在第一个处理之前发送的)

从SDK中调用didReceiveRemoteNotification并在SDK中处理第二个通知之前调用completionHandler,以便我实现UAPushNotificationDelegate方法 receivedBackgroundNotification:(UANotificationContent *)notificationContent completionHandler:(void (^)(UIBackgroundFetchResult))completionHandler,app崩溃抱怨EXC_BREAKPOINT (code=1, subcode=0x103b496f0)这意味着它正试图访问已经由SDK发布的completionHandler

我该如何处理?

ios push-notification urbanairship.com
1个回答
0
投票

收到推送通知后,立即为completionHandler返回receivedBackgroundNotification:(UANotificationContent *)notificationContent completionHandler:(void (^)(UIBackgroundFetchResult))completionHandler,并在此之后执行任务,因为iOS唤醒应用程序30秒。

这对我有用,自改变以来没有发生过这次崩溃。

© www.soinside.com 2019 - 2024. All rights reserved.