Open facebook link in iOS Safari

1

Scenery:

  • I have an app, which links to a particular page on facebook.
  • When the user clicks the link, it should be directed to the page and loaded with Safari.
  • However, if the user has the Facebook App installed on the iPhone, iOS directs the link to the App and the Facebook App does not show the page.

    Would anyone know how do I determine that a link should be open in Safari, not the Facebook App?

    Code used: Objective-C.

asked by anonymous 20.01.2015 / 23:00

2 answers

2

As @PauloRodrigues suggested to me on the > link

Just add " ?ref=0 " to the end of the URL.

Being:

 www.facebook.com.br/PAGINA

Getting

www.facebook.com.br/PAGINA?ref=0

This forces the link to open in iOS Safari.

    
22.01.2015 / 16:51
1

Try using this method. Just put deepLink if you want the application to open the facebook application, otherwise open Safari with the given url.

Example of a deep link (appURL): fb: // page / id_page

Sample URL: link

+ (void)openSocialNetworkURLWith:(NSString *)appURL URL:(NSString *)url {

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:appURL]]) {

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]];

    } else {

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    }
}
    
21.01.2015 / 13:54