iOS 推送通知 - 如何在没有声音的情况下指定警报和徽章? [英] iOS Push Notifications- How to specify alert and badge with NO sound?

查看:29
本文介绍了iOS 推送通知 - 如何在没有声音的情况下指定警报和徽章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何发送没有声音的推送通知.

I am wondering how to send a Push Notification with NO sound.

来自 Apple 网站:

此文件中的声音作为警报播放.如果声音文件不存在或默认被指定为值,默认警报播放声音.

The sound in this file is played as an alert. If the sound file doesn’t exist or default is specified as the value, the default alert sound is played.

这表示如果我对声音文件使用默认",或者如果我指定一个不存在的声音文件,它将播放默认警报声音.

This says that if I use "default" for the sound file or if I specify a sound file that does not exist, it will play the default alert sound.

但它确实具体说明了如何没有声音......如果我只是在有效载荷中不包含声音(将其保留),这是否意味着不会播放声音?

But it does specifically state how to have no sound... If I just do not include a sound in the payload (leave it out), will this mean that there will be no sound played?

谢谢

推荐答案

如果我只是在有效载荷中不包含声音(将其忽略),这是否意味着不会播放声音?

If I just do not include a sound in the payload (leave it out), will this mean that there will be no sound played?

没错.只是不要在有效负载中包含 sound.或者,如果您永远不想播放声音,甚至不要注册声音通知类型.

That's right. Just don't include sound in the payload. Or, don't even register for sound notification type if you're never going to want to play sounds.

这篇关于iOS 推送通知 - 如何在没有声音的情况下指定警报和徽章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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