gpt4 book ai didi

ios - 在Objective c iOS 11中静默通知显示标题中的错误

转载 作者:行者123 更新时间:2023-12-01 19:43:55 26 4
gpt4 key购买 nike

我正在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);
}

薪水是:
    {
"aps" = {
"content-available" : 1,
"sound" : ""
};
// You can add custom key-value pair here...
}

接收到通知时调用 didReceiveRemoteNotification方法,但是我的问题是,为什么在接收无提示通知时看到横幅。如何限制通知横幅。

最佳答案

从aps数组中删除多余的键,有效载荷应该是这样的。

"aps" = {
"content-available" : 1
};

关于ios - 在Objective c iOS 11中静默通知显示标题中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51074493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com