Wednesday 27 April 2016

How to identify or detect a device in Salesforce Lightning Component

Salesforce provides global function called $Browser. By using this, you can dynamically identify or detect a device and display contents based on device.

The $Browser global value provider returns information about the hardware and operating system of the browser accessing the application.

  1. <aura:component >
  2.     <aura:if isTrue="{!$Browser.isTablet}">
  3.         You are running this page from your tablet.
  4.     </aura:if>
  5.    
  6.     <aura:if isTrue="{!$Browser.isAndroid}">
  7.         You are running this page from your andriod device.
  8.     </aura:if>
  9.    
  10.     <aura:if isTrue="{!$Browser.formFactor=='DESKTOP'}">
  11.         You are running this page from your desktop.
  12.     </aura:if>
  13. </aura:component>


Reference:


3 comments:


  1. this blog is really useful and it is very interesting thanks for sharing , it is really good and exclusive.
    salesforce Training in Chennai

    ReplyDelete


  2. thanks for sharing this nice information.wonderful explantion
    your way of explanation is good


    Salesforce Training in Chennai

    ReplyDelete
  3. This blog having the details of Processes running. The way of runing is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
    Hadoop Training in Chennai

    ReplyDelete

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...