0

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'
        }),
    );
}

}

2

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

enter image description here


Comparatively, when you check the docs of pill, it is available for all containers - Lightning Experience, Lightning Communities, Salesforce Mobile App, Standalone Lightning App

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.