Is it possible to set custom notification sound key to iOS and custom android_channel_id to android message?

Is it possible to set custom notification sound key to iOS and custom android_channel_id to android message?

Basically we want to change call notification sound to different one. I can only see pushNotification where I can pass notification title. For other thing like android_channel_id and sound where I can pass it?

Screenshot 2022-01-21 at 7 03 53 PM
Additionally I use below code to send notification:

var receiverID = "UID";
var customData = {
  latitude: "50.6192171633316",
  longitude: "-72.68182268750002"
};

var customType = "location";
var receiverType = CometChat.RECEIVER_TYPE.USER;
var metadata = {
  pushNotification: "Your Notification Message",
};

var customMessage = new CometChat.CustomMessage(
  receiverID,
  receiverType,
  customType,
  customData
);

customMessage.setMetadata(metadata);

CometChat.sendCustomMessage(customMessage).then(
  message => {
    // Message sent successfully.
    console.log("custom message sent successfully", message);
  },
  error => {
    console.log("custom message sending failed with error", error);
    // Handle exception.
  }
);

Answering myself, this may be helps someone.

I have removed all notification from cometchat and implemented custom push notification, just save FCM tokens to the users metadata and send it whenever needed.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.