function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Joe BubelJoe Bubel 

Lightning Toast on Salesforce 1 iOS

Using Salesforce 1
I have a quickAction component that issues Toasts.  
It works perfectly on Andriod and within Salesforce browser.

But on any iOS device, the toast message(s) will not appear until after I close the quickActionApp, or I press the home key and go back into Salesforce 1.  It is as though the actual toast.fire() isn't occuring.

Thinking maybe it was my markup, I then created a very simple component, all it does is on init, issue a toast.  Again, NO TOAST messages until I close the quickAction, or flip out and back into Salesforce 1.

The only heartbeat I get, is if I use one component to open the other, using the (unsupported) navigateToComponent event on Init.  It looks good, and the toasts are posted, but the new page is no longer a quickAction nor is it fully function (ie, not scrollable).  

This seems to be a limitation with SF1 for iOS, anyone else experience this?  Is there another way to open a QuickAction (or Component) from another component?

Thanks in advance
Abhishek VaideeswaranAbhishek Vaideeswaran
Hi Joe,
if you want to show toasts after complete operation of that quick action, then fire close quick action $A.get("e.force:closeQuickAction").fire() first and then try to fire The toasts which should work on any platform because we recently implemented something like this and it works in iOS, Android and lightning as well.
Joe BubelJoe Bubel
Hi Abhishek,
I don't want to close the QuickAction, I want to show the toast after something happens ie, file uploaded, or click save.

This code works fine on the andriod, but not on ios.

Here is my toast only Component:
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,force:appHostable" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.doToast}" />
</aura:component>

and the js
    doToast : function(component, event, helper) {
       var wID = component.get("v.recordId");
        var action = component.get("c.getLineItems");
        action.setParams({"workOrderId": wID});
        action.setCallback(this, function(a){
            component.set("v.LineItems",a.getReturnValue());
               var toastEvent = $A.get("e.force:showToast");
               toastEvent.setParams({
                   "type": "success",
                   "title": "Success!",
                   "message": "The app has started. V30"
               });
               toastEvent.fire();
        });
        $A.enqueueAction(action);
    },