redirecting from facebook link to my mobile app (ionic)

I'm building an app where users can post links to facebook. Basically they can post a text (status)/photo to facebook and what I want to do is, when someone click that status/photo in facebook, it should be open up in my mobile app (which already installed in the users mobile)

So far I've red some things about linking with html5 tags, but the problem is I cannot do that in a facebook post.

How can I archive this with ionic (Im a web developer and pretty new to mobile development and cannot get my head around with this ;)

any help would be much appreciated

EDIT - (updated the question with sample workflow)

Consider following scenario

  • user uploads a photo in the mobile app
  • user post the same photo to facebook
  • when someone click that photo on facebook, it should direct to that users mobile app and open the photo in the mobile app

Per the original posters request, my comment turned out to be the answer.

http://mcgivery.com/using-custom-url-schemes-ionic-framework-app/

The above tutorial will explain how to create a custom URL scheme so when the device opens a link, it will open the application instead of the browser.

According to your needs i think this plugin is helping you (http://plugins.cordova.io/#/package/com.ccsoft.plugin.cordovafacebook). Its used one of our projects and its working fine for us, but integration with facebook is little bit complex (https://developers.facebook.com/docs/android/getting-started/).You need to setup a facebook application (https://developers.facebook.com/) to achive this.