且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS推送通知无声音

更新时间:2023-02-16 22:50:14

根据

According to Apple's documentation you need to specify default if you want to the default push notification to be played:

应用程序捆绑包中声音文件的名称.该文件中的声音是 起到警示作用.如果声音文件不存在或默认为 指定为值时,将播放默认警报声音.音讯 必须采用与以下设备兼容的音频数据格式之一 系统声音;有关详细信息,请参见准备自定义警报声音.

The name of a sound file in the app bundle. 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. The audio must be in one of the audio data formats that are compatible with system sounds; see Preparing Custom Alert Sounds for details.

最终的JSON输出:

{
    "aps" :     {
        "alert" : "Test Push Message",
        "sound" : "default"
    };
}