Api to differentiate whether app is invoked from Desktop web or mobile web

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

We are designing a RWD page. SO we need to know from where app is invoked. If it is launched from Mobile browser we need to do certain functionality.If it is launched from Desktop browser we need to do another functionality.

Hi @Avv Fewguson​ , If it is for RWD then it is better to go with deviceWidth based on which you can implement your functionality. So if kony.os.deviceInfo().deivceWidth is less than 320 then consider it as mobile web!

Hi @Avv Fewguson​ ,

Check the below code:

if(kony.os.deviceInfo().category == "iphone" || kony.os.deviceInfo().category == "android"){

//Mobile Web

}else{

//Desktop Web

//it will return browser name i.e., kony.os.deviceInfo().category == "Chrome"

}

Hi @Levh Clvwkson​ ,

kony.os.deviceInfo().category doesn't return iphone or android in mobile web. It returns chrome similar to Desktop web. So i followed @Kevin Jones​ suggestion. Used screenWidth to differentiate whether its mobile web or desktop web.

Thanks,