Add as Facebook friend on click iPhone
In my app I need to implement +add as friend type button to send Facebook friend requests. And if the user is not logged in then the login dialog should appear. I searched in Google and also in Stack Overflow and one or two questions for iOS add as friend button but with no 开发者_如何学JAVAanswer, so I could not get anything working.
It's as simple as having a link like this:
<a target="_blank" href="http://www.facebook.com/dialog/friends/?id=FACEBOOK_PROFILE_ID&app_id=FACEBOOK_APP_ID&redirect_uri=SOME_URL"> ADD AS FRIEND </a>
So the URL to use is:
http://www.facebook.com/dialog/friends/?id=FACEBOOK_PROFILE_ID&app_id=FACEBOOK_APP_ID&redirect_uri=SOME_URL
And you have to replace FACEBOOK_PROFILE_ID
, FACEBOOK_APP_ID
, and SOME_URL
by the real values.
On the iPhone, I would open a UIWebView pointing to this URL.
精彩评论