本文介绍了如果您在桌面上阅读过 Facebook Messenger,它如何清除锁定屏幕上的推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Facebook 上收到消息时,我会在锁定屏幕 (iOS) 上收到推送通知.然后我在桌面上阅读了这条消息.紧接着,这个推送通知消失了,与手机没有任何交互.我如何自己实现相同的操作来删除过时的通知?

When I receive a message on Facebook I get a push notification on a lock screen (iOS). Then I read this message on desktop. Right after that this push notification disappear without any interactions with the phone. How can I implement the same thing myself for removing outdated notifications?

第二种用法可能是将通知拼接在一起.例如,当有人喜欢您的照片时,Instagram 会向您发送推送.在 20 个赞后,您的通知屏幕已损坏且无法读取.但是使用与 Facebook 相同的主体似乎可以删除相同类型的先前通知并使用增加的计数器创建新通知.没有用户 A 喜欢照片 X,用户 B 喜欢照片 Y 等",而是20 个用户喜欢照片 Z".

The second usage could be stitching notifications together. For instance Instagram sends you a push when someone liked your photo. After 20 likes your notifications screen is ruined and unreadable. But using the same principal as Facebook does it seem to be possible remove previous notification of the same sort and create new with the increased counter. No "User A liked photo X, User B liked photo Y etc", but "20 users liked photo Z" instead.

我在这里看到了一些关于类似主题的线索,但到目前为止仍然没有答案.谢谢!

I've seen couple of treads on similar topics here, but still no answer so far. Thanks!

推荐答案

参见 多任务处理增强,特别是静默推送通知.使用静默推送,您可以通知您的应用有新内容可用,还可以下载该内容和/或设置徽章编号,例如,无需在通知中心"中显示通知.您必须使用远程通知值设置 UIBackgroundModes 才能使其工作.

See the Multitasking Enhancements and the silent push notifications in particular. Using the silent push you can notify your app that new content is available and also download that content and/or set the badge number for example without displaying the notification in the "Notification Center". You'll have to set the UIBackgroundModes with the remote-notification value in order to make this work.

如果用户在其他平台上看到了内容并清除了您的 iOS 应用上的徽章编号,您可以发送静默推送.

You can send silent push if the user has seen the content on another platform and clear the badge number on your iOS app.

这篇关于如果您在桌面上阅读过 Facebook Messenger,它如何清除锁定屏幕上的推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 00:27