【发布时间】:2018-12-07 00:58:42
【问题描述】:
我正在 ios 11 的 Objective c 代码中实现静默通知。通过添加此方法使用 FCM 通知。 What is Silent Push Notification? When does the device receive it?
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
//Success
handler(UIBackgroundFetchResultNewData);
}
而paylod是:
{
"aps" = {
"content-available" : 1,
"sound" : ""
};
// You can add custom key-value pair here...
}
didReceiveRemoteNotification 收到通知时调用方法但我的问题是为什么收到无提示通知时横幅可见。如何限制通知横幅。
【问题讨论】:
-
您可以尝试从您的有效负载中删除
"sound" : ""吗?
标签: ios objective-c silent-notification