cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect the client is mobile or desktop/tablet?

How to detect the client is mobile or desktop/tablet?

Hi,

 

I am developing a customized extension and need to detect the client is "Desktop/Tablet" or "mobile" and then I can send the agent type to a remote script and get it's result.

Is there any existing class and function that I can use on my extension? Or I need to use 3rd class/library in my extension to detect?

Thank you.

 

Ps. I scan magento2 source code and see the /vendor/magento/zendframework1/library/Zend/Http/UserAgent/ and I have no idea to use it.