I want to add custom sound to my push notification and I have tried a lot of things but I could not get it to work
I tired this this and this but it did not work and I do not want to use local notification because I want it to work on both IOS and android and I want it to work in the background
this is my code
void sendPushMessage(String token, String body, String title) async {
await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
headers: <String, String>{
'Content-Type': 'application/json',
'Authorization':
'private key'
},
body: jsonEncode(<String, dynamic>{
'Priority': 'high',
'data': <String, dynamic>{
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
'status': 'done',
'title': title,
"sound": "test.wav",
},
'notification': <String, dynamic>{
'title': title,
'body': body,
"sound": "test.wav",
'android_channel_id': ''
},
'to': token
}));
}
and I added the test.wav file to res/raw/ path