Swift - GCM:不显示iOS远程推送通知

问题描述:

我已在我的iOS应用中实施GCM推送通知。我只需要通知与新内容同步。这很好。但我不想让通知显示给用户。我如何隐藏它? enter image description hereSwift - GCM:不显示iOS远程推送通知

您需要的content_available参数发送到true

https://developers.google.com/cloud-messaging/http-server-ref

您还需要在自己的应用Info.plist文件添加remote-notificationsUIBackgroundModehttps://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW22

+0

嗯,我只是需要不显示通知来时。这真的是解决方案吗? –

+0

@PanMluvčí,是的。你想要的是一个无声的远程通知,为此你需要做这个答案中陈述的两件事。 –

+0

好吧,我已经添加 远程通知 我Info.plist文件 然后告诉我的队友后端设置content_available .......仍然通知可见:-( –