简体   繁体   English

配置收到推送通知时播放的声音

[英]Configuring the sound played when Push Notification is received

How can we configure the sound which gets played when an application is in the background and a push notification is received?我们如何配置应用程序在后台并收到推送通知时播放的声音?

Check out the "The Notification Payload" section of this document .查看本文档“通知负载”部分


Example JSON Payload (adapted from above document):示例 JSON 有效载荷(改编自上述文档):

{
    "aps" : {
        "alert" : "You got your emails.",
        "badge" : 9,
        "sound" : "bingbong.aiff"
    }
}

The key you're looking for here is sound , it's a string that points to an aiff , caf , or wav file within your bundle.你在这里寻找的关键是sound ,它是一个指向你的包中的aiffcafwav文件的字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM