I have created an LWC component with just one button and on click of that button I am trying to show notification using ShowToastEvent, This is working fine on desktop but not working in SF mobile app.
HTML File
</div>
Js File
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class ToastNotificationOnMobile extends LightningElement {
handleClick(){
this.dispatchEvent(
new ShowToastEvent({
title: 'Success',
message: 'Welcome',
variant: 'success',
mode : 'dismissable'
}),
);
}
}
Best Answer
It is because toast is not available for Mobile App
If you check the documentation, it says that toast is just available for Lightning Experience (one container) only
Comparatively, when you check the docs of pill, it is available for all containers - Lightning Experience, Lightning Communities, Salesforce Mobile App, Standalone Lightning App