0

There are very similar questions on the board but I still didn't find satisfying results for my topic.

I have to implement links on our website to redirect to Facebook and Google+ for check-ins to my company. It should be possible to click on the link on the website and my smartphone (Android) should ask if this link should open for example the Facebook App or the Link to the Site in the Smartphone browser.

Is there a link that the smartphone can parse: -the app is installed, would you like to open the G+ or Facebook app -or open the web-browser from the smartphone

The link should also redirect me on the Facebook/G+ site of my company. So after the user chooses the app or web browser he/she should be able to check-in with one click.

I think there are already standards for links like this. I just can't find any satisfying results for my problem.

I am currently testing with Android but it would be cool if the links would be also working with iOS :-)

This would be a similar question.

I added this html snippet to my page: href="fb://page/77664937087"

The problem is I have to parse if the user has installed the app or the browser. In this case the app would open. But I need some sort of if-statement. I am no javascript pro so I need some help for this.

And I don't want to implement 2 seperate links for app or browser.

Community
  • 1
  • 1
tagel1111
  • 1
  • 1
  • Welcome to Stack Overflow. Can you edit your question and add links to some of the questions that you think are similar, and explain why the aren't the right answer for you - what features are still missing. – Richard Neish Mar 25 '14 at 09:36

1 Answers1

0

You can use this method of UIApplication to check whether the app is installed:

- (BOOL)canOpenURL:(NSURL *)url NS_AVAILABLE_IOS(3_0);

If can not you can open the url using following code:

NSString *url = @"xxxxxx"; //your link here
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
Yong Li
  • 266
  • 1
  • 7
  • I want to test the app with a local website on my computer.That is what I have so far: – tagel1111 Mar 25 '14 at 13:19
  • Is it possible to modify a link so that the smartphone opens a dialog and I can choose which app I want to start. (Android) – tagel1111 Mar 25 '14 at 14:16