I am working on an app where I need to put a button that will redirect users to a certain Facebook page. Normally tapping on this button should open the profile in the Facebook app or in the navigator if Facebook is not installed. Plus I would like to do the same thing with a twitter page.
I would like like to know how to do that.
Tap in the top right of Facebook. Scroll down and tap Settings. Tap Apps and Websites, then tap Logged in with Facebook. Tap on the name of the app.
A Facebook App ID is a unique number that identifies your app when you request ads from Audience Network. Each app on Audience Network must have a unique Facebook App ID. You may already have an App ID if your app uses Facebook Login or Facebook Analytics for Apps.
It all comes down to the custom url schemes. Facbook's is fb://
so if you were to open fb://profile/zuck
Mobile Safari would kick you over to the Facebook app and load Mark Zuckerbergs profile page. There currently is a bug in the new Facebook app preventing it from loading profiles correctly.
To check if the user's device can respond to a URL scheme check out this post.
EDIT::
As far as Twitter you may want to check for a few different Twitter clients like twitter://
or tweetbot://
before kicking the user over to https://twitter.com/#!/<# User Name #>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With