I have tried to comb through the Facebook Developers documentation http://developers.facebook.com/ but haven't been able to answer this question.
I would like to be able to send Facebook friend requests and accept friend requests in a webapp. Does Facebook API allow/enable such a function?
Have you tried this ? Its the recommended option since the api doesnt allow you to add randomly people with a call.
http://developers.facebook.com/docs/reference/dialogs/friends/
Edit: Here you have the reference for dialogs in android sdk
https://developers.facebook.com/docs/reference/androidsdk/dialog/
Related
I already read a post here How to send friend request using Facebook dialogs on Android?
However, I'm not sure how to implement the advice. It seems like the accepted answer is now unavailable from facebook. And the second answer, which seems to be how people do it now, I'm not sure what params to use and I can't find it anywhere in the facebook docs.
Here is some info on how to send requests from facebook.
https://developers.facebook.com/docs/android/send-requests
I suggest you download the sample app (FriendSmash) to see how they implement Facebook api on Android application
I'd like to target a message to my Facebook friends who use iOS, and separately, Android. If I'm going to recommend them a particular app, for example, I'd like to ping only those who have the right OS. Presumably Facebook has this information. Is there a way for me to retrieve it?
I do not think Facebook would expose this kind of information on their API. What you could do is use Parse and its Installation class. By doing so, you will get specific device information of each of your users. Then you can use the Parse Push SDK to target specific users based on this information. As an added bonus, Parse also offers Facebook integration, so it might be the tool you are looking for.
You can use the Facebook Message dialog for iOS and Android to let people send messages to their friends via Facebook Messenger. See https://developers.facebook.com/docs/android/share#message-dialog and https://developers.facebook.com/docs/ios/share#message-dialog
However, in v2.0 of the API there is no way to find out which of a users non-app-using friends are using Facebook on which platform - and in any case, the dialogs don't let you pre-fill the recipients.
If you want people to invite their friends, but want the recipient to end up being redirected to the correct (iOS or Android) version of your app, I suggest sharing the same URL, and then doing user-agent detection when someone clicks on the link to determine if you want to redirect the users to Google Play or the Apple App Store. Services like Deeplink.me may provide this as a hosted service: https://www.deeplink.me/
Users of my Rails app can authenticate in one of these 2 manners:
Using their Facebook account
Using our own authentication
I'm using Facebook SDK on Android and devise and omniauth on Rails.
How do I authenticate against my Rails app on Android so I can then fetch the information I need from the server?
NB: I've noticed this question is getting a fair amount of views recently. Please don't follow the advice given in this thread too closely -- the web moves fast and it dates from 3 years ago!
This can be done using the fb_graph gem (not fbgraph!).
You can just add it to your gemfile and do
user = FbGraph::User.me(token).fetch
where token is the oauth token you got by using, for example, the Facebook SDK on Android.
user.email will be the user's email address (if you set up the necessary permissions).
You can use this URL for testing:
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=https://www.facebook.com/connect/login_success.html&response_type=token
That totally depends on how your authentication system works. You will need to create an API on your server to handle communication from the Android app and pass information between both using the API.
Niraj Shah is completely right, though the answer might not be detailed enough for you. For an in-depth answer to your question, have a look at Securing an API railscast by Ryan Bates that has been released only recently. It covers HTTP Basic Auth.
You might also want to have a look at the more advanced option to secure your API / provide registered users access to their data. There's a railscast about this one as well here: http://railscasts.com/episodes/353-oauth-with-doorkeeper - though it's a pro episode, so you need to sign up for it in order to watch it.
Francisco, I have the exact same need.
The devise scenario using token_authenticatable seems straightforward and shouldn't be a problem but I'm not sure the best way to handle the Facebook scenario. On the web side, for FB auth I'm using omniauth-facebook as documented here: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview. I think this uses OAuth with FB as a provider so it's a good possibility that the latest RailsCast about doorkeeper securing an API with OAuth should do the trick. I haven't tried it yet but will do so soon unless you beat me to it. Here is the link: http://railscasts.com/episodes/353-oauth-with-doorkeeper.
i have the following problem: I tried to post sth. to Facebook by using ACTION_SEND Intent to pass a String to the Facebook application.
Now I know this is currently not possible.
I don't want to code my own Facebook login, logout, session handling stuff in my application.
Question is:
If someone has the Facebook App installed and is logged in,
can I use the authentification information to post sth. on his Facebook wall?
Or, what is the easiest way to get sth. posted?
thanks
I would recommend using the Spring Social Facebook library. It will take care of all the OAuth stuff for you and provide you with a nice Facebook API you can interact with. The API allows you to do a lot more things than just post.
The downside is you have to install the jar files with your app and do a little setup. There is a good example of how to do this for Android in the spring-android-showcase-client in the spring-android-samples project.
Any Example suggestion that really works currently with Twitter OAuth?
I just need a simple API to post from an Android App, no need for something fancy and full feature, something that just works fine for authentication, doesn't crash and can update status.
I tried at least 4 examples poested before, all of them fail at some point.
Regards,
I had success with the Twitter4J library. For my purposes the login credentials were hardcoded into my app though. It was not a situation where each user could log in to their own twitter account. But the library was very easy to use for retrieving statuses and posting a tweet.