我正在浏览Google Cloud Messaging System https://developers.google.com/cloud-messaging/concept-options的概念选项,我看到了这一点:
App behavior when receiving messages that include both notification and data payloads
depends on whether the app is in the background, or the foreground —essentially,
whether or not it is active at the time of receipt.
- When in the background, apps receive the notification payload in the notification tray,
and only handle the data payload when the user taps on the notification.
- When in the foreground, your app receives a bundle with both payloads available.
是否可以向特定的Android设备发送推送消息,然后通过应用程序的逻辑验证其内容? 然后,如果应用验证了内容并且它是正确的 - 通知用户,在其他情况下保持沉默,则忽略推送消息并且甚至不显示通知图标? 谢谢!
答案 0 :(得分:0)
你必须跟踪gcm类型,因为这样的gcm被调用,取决于你可以显示的&隐藏通知。
答案 1 :(得分:0)
要向用户显示推送通知,控制权仅在您手中。只需应用您想要的检查,如果条件满足,则生成通知。