Android Push Notifications custom sound not working

I am using Ionic react 6 with capacitor 4 to build an app that requires notifications with custom sound, but its always coming with default sound,
I created a push notification channel using this code:

        description: 'General Notifications',
        id: 'fcm_default_channel',
        importance: 5,
        lights: true,
        name: 'My notification channel',
        sound: 'jingle.wav',
        vibration: true,
        visibility: 1,
        lightColor: '#FF0000'
        console.log('push channel created: ');
    }).catch(error =>{
        console.error('push channel error: ', error);

and its getting created successfully, and this the payload I am sending to FCM from sever using php

$fields = [
		"to" => $fcmToken, 
		"notification" => [
			  "title" => "New Message", 
			  "body" =>  $message, 
			  "sound" => "jingle.wav",
			  "channelId" => 'fcm_default_channel',
			  "notificationCount" => 1,
			  "defaultSound"=> false,
		"data" => [
				 "type" => "message",
				 "scope" => "user" 

and here is my sound file in /res/raw

and still can get the sound file to run, its always coming with device default notification sound, I tried real device, emulator, all same problem


I think the problem is from different ways of specifying channel in android versions.

“channel_id” => ‘fcm_default_channel’, ====> for android >=8

“android_channel_id” => ‘fcm_default_channel’, ====> for android <8

Also while creating the channel, the sound should have path relative to res/raw

in your case
sound: ‘res/raw/jingle.wav’,