In the lightning component controller, I have the following:
({
doInit: function(cmp, evt, hlp) {
window.setTimeout(
$A.getCallback(function() {
var omniAPI = cmp.find("omniToolkit");
omniAPI.setServicePresenceStatus({
statusId: "0N561000000027Y",
callback: function(result) {
if (result.success) {
console.log('Set status successful');
console.log('Current statusId is: ' + result.statusId);
console.log('Channel list attached to this status is: ' + result.channels);
} else {
console.log('Set status failed');
}
}
});
}), 100
)
//helper.setStatus(cmp, evt, hlp);
},
})
In my component I have:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:omniToolkitAPI aura:id="omniToolkit" />
<!--
<lightning:utilityBarAPI aura:id="utilitybar" />
<lightning:button label="Get Status" onclick="{! c.getStatus }" />
<lightning:button label="Set Status" onclick="{! c.setStatus }" />
-->
</aura:component>
How do I go about getting this to load automatically? If I click on the lightning component, I will get signed into Omni-channel. It would be ideal to have this happen on load.
As a custom solution, you can consider this flow.
It implies custom 'Login Flow' to be configured
https://help.salesforce.com/s/articleView?id=xcloud.security_login_flow.htm&type=5+ custom development.