0

当应用程序在后台时,如何将推送通知有效负载数据插入数据库。我尝试了 content-available 标签,但它对我不起作用。请帮帮我

4

1 回答 1

1

content-available 标签也需要并使用此方法:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    //add notification data to your database here

    completionHandler(UIBackgroundFetchResultNewData);
}

并将其添加到您的 xcode 中。

在此处输入图像描述

于 2016-08-02T08:10:33.760 回答