Ionic 3 how to know if facebook app installed

Hi, I have an onclick that redirect link of fb profile to facebook app. I just want to know what if I don’t have facebook app installed in my ios/android. I want to redirect it to the browser if facebook not installed.

please see below sample code:

<ion-item class="item item-icon-right" nav-clear menu-close ui-sref onclick="window.open('fb://profile/100000073894564', '_system');" >
      <i class="icon ion-social-facebook"></i>
      <h2 class="menu-text">Facebook Page</h2>
    </ion-item>