如何使用 OneSignal 发送自定义声音推送通知?

How to send custom sound push notification with OneSignal?

我想知道如何使用 OneSignal 发送自定义声音通知。不幸的是,他们的文档仅涵盖通过仪表板发送:link

我的方法无效:

OneSignal.defaultClient().postNotification([
"contents": ["en": "test"],
"include_player_ids": [pushId],
"aps": ["sound": "sound.wav"],
])

这也没有用:

OneSignal.defaultClient().postNotification([
"contents": ["en": "test"],
"include_player_ids": [pushId],
"sound": "sound.wav",
])

我在这里错过了什么?

好的,看来 "ios_sound": "sound.wav" 可以做到:

https://documentation.onesignal.com/reference#page-create-notification