Forum Discussion

1 Reply

  • this code may detect all devices (Maybe you can search user-agent for AppleTV and Apple Watch). The ua variable contains the lowercase user-agent, so only search for lowercase string.

     

    when HTTP_REQUEST {
        if {[set ua [string tolower [HTTP::header User-Agent]]] contains "iphone" || $ua contains "ipad" || $ua contains "android"} {
             This client is an iPhone, iPad or an Android device
        }
    }

    Note : code updated (a closing bracket was missing)