【问题标题】:iOS - Urban Airship - handle multiple background remote notificationsiOS - Urban Airship - 处理多个后台远程通知
【发布时间】:2018-11-30 22:10:11
【问题描述】:

这是应用在后台

的时候

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

当我同时发送两个推送通知时会出现问题(第二个在第一个处理之前立即发送)

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

我该如何处理?

【问题讨论】:

标签: ios push-notification urbanairship.com


【解决方案1】:

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

这对我有用,自从更改以来还没有发生过这种崩溃。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多