How to detect browser platform and mobile browser in Ionic 4 project?

Hi, I want to call a function in mobile browser or desktop( ionic 4 cordova browser platform) and not in a cordova android/ios. I tried using platform but no luck, unable to identify desktop and mobile browser. Not sure what I am missing here.