Clicking a button should open an app instead of a webpage

I have a button within my app which opens a webpage for now. I want it to open the android app (on an droid phone) or iOS app (on iphone) when user clicks on that button. What is a better way of doing this.