Open social media links in default app (twitter/facebook/instagram/etc.)

I'm looking for a way to ensure apps which have registered an app link open within the assigned app when my Xamarin.Forms app opens the uri. Currently, YouTube links are opening in the YouTube app, but other links are opening in the browser, even though twitter/facebook/instagram are install and other links launch in the appropriate app. Can someone help?

Tagged:

Answers

  • I'm also looking for a solution to this. Any luck yet Dylan?

  • I solved it by writing my own AppLinkResolver (by implementing Rivets.IAppLinkResolver) and used my own resolver rather than the default one. I found that sometimes the default Rivets resolver, doesn't properly read the app links on the page.

    Also, some websites do not render the proper meta tags so the Resolver doesn't know how to app link but in my case, I could write custom implementations for it since I was using my own.

  • SadhikBSadhikB USMember

    Did not find a perfect solution but please check below....

    Device.OpenUri(new Uri("twitter://user?user_id=idfrompageviewsource"));
    Device.OpenUri(new Uri("link"));

    Works fine if app is available in IOS and Android.
    Throws error in android if app unavailable
    Does nothing in IOS if app is unavailable

    If anyone found a perfect solution, please share.

  • igorkr_10igorkr_10 Member ✭✭✭
    > @SadhikB said:
    > Did not find a perfect solution but please check below....
    >
    > Device.OpenUri(new Uri("twitter://user?user_id=idfrompageviewsource"));
    > Device.OpenUri(new Uri("link"));
    >
    > Works fine if app is available in IOS and Android.
    > Throws error in android if app unavailable
    > Does nothing in IOS if app is unavailable
    >
    > If anyone found a perfect solution, please share.

    Good solution. Works for me for a long time.
Sign In or Register to comment.