我目前正在flutter上使用firebase_messaging实现推送通知。目前,它适用于android。但是对于ios,它不起作用。我在bundle资源中插入了alarm.caf,下面是json的有效负载。
{
"to": "id_key",
"collapse_key": "type_a",
"priority": "high",
"content_available": true,
"notification": {
"body": "This is a testing for push notification",
"title": "Push Notification",
"sound": "alarm.caf",
},
"data": {
"screen": "/SecondPage",
"wifi_strength": "good",
"owner_name": "Jeff ",
"device_name": "Kitchen",
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
}
现在,当我将声音更改为“默认”时,它将提供通知的默认声音,但是我想使用自定义声音。它甚至不会振动。