是否有可能发送一个“无声的"?在 iPhone 上推送通知(对用户没有任何提醒)? [英] Is it possible to send a "silent" push notification on iPhone (without any alert to the user)?

查看:24
本文介绍了是否有可能发送一个“无声的"?在 iPhone 上推送通知(对用户没有任何提醒)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在聊天应用上执行此操作,以通知客户端有新数据要从服务器获取.

I need to do it on a chat app to notice the client that there is new data to fetch from the server.

我知道从技术上讲可以使用空负载(至少在 ios 5 设备上它可以工作),但 Apple 可以将其视为滥用服务还是可以这样做?

I know that technically it is possible with an empty payload (at least on ios 5 device it worked), but can Apple see it as abuse of service or is it OK to do it?

在 ios 4 设备上技术上可行吗?

And is it technically possible on ios 4 device?

推荐答案

是的,只增加徽章编号,不发送声音和警报,所以,App图标上会有一个徽章.

Yes, increment only badge number, dont send sound and alert, So, there will be one badge on the App icon.

因此,这里的徽章编号将在不知不觉中增加,以表明当用户观看应用图标时已收到某些内容.

So, here unknowingly the badge number will be incremented to show that something has been recieved when user watches the app icon.

但是您的设备不会收到警报或空负载,也不会收到声音,这也是因为您在 iPhone 上要求静默"推送通知

But your device won't recive alert or empty payload and won't recieve sound also because you asked for "silent" push notification on iPhone

并且在 AppDelegate 中配置时,只配置徽章

and while configuring in AppDelegate, configure only badges

 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge];

希望对你有帮助

这篇关于是否有可能发送一个“无声的"?在 iPhone 上推送通知(对用户没有任何提醒)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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