2

on my app I have a link to https://www.facebook.com/xxxx. Opens on a external browser.

is possible to open the facebook app instead of web browser, of course if the app is no installed must open a browser.

Best Regards

Kandy
  • 387
  • 1
  • 13

1 Answers1

1

If the app is installed it should open at least on Android automatically when you navigate to it.

If you want to explicitly link to facebook you can use this link type: https://stackoverflow.com/a/30231726/756809

Notice that you can use the canOpen API to check if this is supported on iOS.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks Shai On iOs and Android always open the webBrowser. Is I change the url to fb://www.facebook.com its opened the facebook app, but if the App is not installed, the link don't works. Regards – Kandy Apr 10 '20 at 16:40
  • I found the solution: if the url is (https://www.facebook.com/CodenameOne/) always is opened on the webbrowser, but if we link to a content, for example: /post/ (https://www.facebook.com/CodenameOne/posts/) works fine, if the app is installed is opened and if is not instaled is opened on a webbrowser. – Kandy Apr 10 '20 at 17:33
  • On iOS you can use `CN.canExecute(url)` notice that it can return null. This will help you make an informed decision – Shai Almog Apr 11 '20 at 04:33