Lightning App Background Utility Items

In this blog, I am going to show how to use the background utility items run without a visible entry in the utility bar. background utility items provide an unobtrusive way to add functionality to your Lightning apps without cluttering the user experience. In standard navigation and console navigation apps, you can create and add background utility items to invisibly execute code. Implement the lightning:backgroundUtilityItem interface to use a custom component as a background utility item. In this example, I am logging the details into the custom object whenever the user landing into the application for audit purpose. here is the simple custom object that will be used to store the audit history

Apex Class

Lightning Component 

Add Component to  Utility Bar 

  1. Navigate to Setup > App Manager > New Lightning App
  2. Edit the Lightning  App > Under the App Settings >Utility Items > Add Utility item as shown below. Save it 

Testing 

After adding the background utility item to the app whenever the user landed on the application it will log into the custom object and shows the notification message as shown below.