Unable to get notification for custom messages

Hello Team,
I’ve successfully upgraded my pack from Trial to Meteoroid , I am sharing meeting detail as custom message in chat in Group, No notification coming for custom message, but working fine (recieving notifications ) for Text, Media messages. custom Message delivering , display is also working fine for all group member, only issue is no notification is coming, Please let me know how to get notification for custom messages, I am sharing my custom message structure here:
var receiverID = guid;
var customData = {
isVideoCall: isVideoCall,
Message: msg,
Status:1,
};
var customType = “meeting”;
var receiverType = CometChat.RECEIVER_TYPE.GROUP;

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

Please reply asap…

Hello @shaheen,

You need to add metadata in your custom message. The metadata should have a pushNotification key and the value is the title of the push notification. For eg:

var meta = {
    pushNotification: "A custom Notification"
}; 
customMessage.setMetadata(meta);

Hope this solves your issue.

Warm Regards,

CometChat Pro
Mayur Bhandari

Hello Mayur,
Thanks for the solution, its working but when I edit the custom message its giving “message edited” as notification, I want change with some text, Please assist.
Also one additional empty message is coming if i edit the custom message.
How to prevent this empty message.
Thanks,
Shaheen

Hello @shaheen,

We were able to reproduce the issue at our end, where on editing a message the push notification title was message edited. I have created a GitHub for the same. You can stay updated on the issue by following the GitHub Issue.

Regarding the empty message, whenever you edit a message you will receive a action message with an action edited. You need to handle such messages on your end by either choosing to display it or not.

GitHub Issue: https://github.com/cometchat-pro/rest-api/issues/22

Warm regards,

CometChat Pro
Mayur Bhandari

1 Like

Hello Mayur,
Thanks, I’ve updated my code as you suggested and handled the action messages. I hope to get solution too for “message edited” notification asap.

Thanks,
Shaheen