Post Created

forceChatter:postCreated

Fired when a post is made.

This event is fired when a post is created on the publisher, such as when you post to your profile feed and other feeds, create a poll, or create a question.

Handle the event by adding an aura:handler tag and defining a client-side controller action. You can handle this event when using forceChatter:publisher and forceChatter:feed, or on any page that has a publisher.

This example displays a toast message when a post is created, assuming the component is added to a record page. The toast is displayed when you create a post on the record page.

1<aura:component implements="flexipage:availableForRecordHome" controller="ContactController">
2	<aura:handler event="forceChatter:postCreated" action="{!c.handlePostCreated}"/>
3	<lightning:notificationsLibrary aura:id="notifLib"/>
4</aura:component>

This client-side controller displays the toast.

1handlePostCreated: function(cmp, event, helper) {
2     cmp.find('notifLib').showToast({
3        "title": "Success!",
4        "message": "You just shared a post."
5    });
6}

This event is handled by the one.app container. It’s supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites.

Attributes 

NameDescriptionTypeDefaultRequired
feedItemIdThe ID of the feed item that has been created.string