iOS版 - 推送通知:它总是显示通知 [英] iOS - Push Notification: does it always display a notification

查看:146
本文介绍了iOS版 - 推送通知:它总是显示通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能发送推送通知,通过APNS,而不显示通知,如果应用程序没有启动? (在这种情况下,接收到的消息将被丢弃)

I'd like to know if it is possible to send a push notification, through APNS, without displaying a notification if the application isn't started? (in this case, the message received will be thrown away)

THX

推荐答案

我可能会误解你的问题,但我假设你是问如何为用户提供选项关闭推送通知的特定方面的用户?

I may be misunderstanding your question, but I am assuming you are asking how to provide the user with options to turn off particular aspects of the push notification?

您必须设置这个在App。也就是说,如果用户希望关闭此特定方面中,你的应用将必须发送出请求他们。

You will have to set this in the App. That is, if the user wishes to turn off this particular aspect, your App will have to send up the request for them.

- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types

所以,如果你还想做徽章,而不再显示提醒:

So, if you still wanted to do badges, but no longer show alerts:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge];

不要忘了令牌重新发送到您的供应商,因为它可能此请求后,已经改变了。

Don't forget to resend the Token to your provider as it may have changed after this request.

这篇关于iOS版 - 推送通知:它总是显示通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆