I am developing an application for a client who wishes to display their Facebook wall posts in the application. The Facebook SDK examples do a wonderful job explaining how to allow users to sign in, but this is not the functionality I desire. I only wish to stream information from a single profile for all application instances without any users having to sign in. If anyone has done anything similar, I would appreciate your suggestions. I will gladly provide any additional details.
One option would be to embed one of the social plugins inside a web view. Otherwise, you could embed an application token inside the application and then make a graph api call to /pageid/feed and use the json result to show the feed entries.
Your client can also create a page which is public and then just get its feed simply via RSS, no need to sign-in and no need for access token in this case. Url for RSS feed should be:
https://www.facebook.com/feeds/page.php?id=PAGE_ID&format=rss20
hope this helps
Related
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/
There is any way to get the last post's made on a facebook wall into a Android app? I want to make some like a RSS reader to get some information on the app.
To explain better-
I have a page on facebook about one football club and there I post several information about news, games etc. Now I have made an android app and my question is whether I can import the post into the android application?
Of course, you can. First of all, if you are new to facebook integration- read the basics of the android integration, login/authorization calling its APIs etc. (not complex at all).
Facebook provides many APIs (for different functions) that uses the access token.
Based on your requirement, you just need to use the API: /PAGE_ID/feed with the page access token to get the feeds of your page. The page access_token can be obtained with the API: me/accounts?fields=access_token,name (Demo) after the user authorization/login.
You can test this API here: Graph API Explorer, using the default token already present there.
Smarter way
(Without using the facebook API)
Since your requirement involves only back-end processes, you can use this method.
First of all, get the Long-lived page access token (that never expires). Detailed steps here. You can use the short-lived token from here.
Use this token and make a \GET request to :
https://graph.facebook.com/PAGE_ID/feed?access_token=TOKEN_FROM_STEP_1
(You can check the result in the browser)
This is it!
I was wondering if it is possible to catch feed of a particular facebook page without any authentication and just display all the posts posted by the admin of the page (possibly along with all comments and likes).
I took a look the facebook developers page but could not find anything relevant.
You can access the public information of any Facebook page without any permissions.
However, You do need to register your app on FB first. They only allow access to their Data from registered apps. It's FB's way of making sure they know who's using which data and how much of it.
You can create a new app at this URL
https://developers.facebook.com/apps
Here are links to mobile/web docs for using Facebook's API
https://developers.facebook.com/docs/
I've seen copious discussion about how to extend an Android app so the user signs into their Facebook account, and can then access the graph etc.
However in my scenario the app only needs to access public data, e.g. wall posts from a public figure whose wall is freely available, even on the Facebook web site to people not signed in. I do NOT want the Android app user bothered with requests to sign into Facebook, when they don't need to.
Can you point me to a sample that does this, or some pointers on how to approach this? I have a set of SDKs I can choose from, but want to understand how I will use the API. I assume some kind of authentication is probably necessary so Facebook can track the source of the requests, but the access used must be read-only as the auth details will be distributed inside the app. Hopefully there's something akind to a Twitter read-only application.
I think this is something you can do pretty much without using any other API than HTTP found on SDK. You can get public data using plain HTTP/S request and then creating a JSONObject from response;
http://graph.facebook.com/facebook/feed
In which facebook' is the user id.
As for code example should you find good examples for making a HTTP request easily. And for further error checking I would recommend taking a look on Util class in official Facebook Android SDK, parseJSON method especially in which errors returned as a JSON response are handled.
This question might sound kiddish to you but I have to ask it.
I need to login from my application to my server using Facebook credentials. Is it actually possible? If the answer is yes, please guide me on this.
Facebook supports OpenID, which you can implement in your app.
http://developers.facebook.com/blog/post/246/
You can actually log in to stackoverflow using your facebook account as it uses OpenID as well.
Rohit, what Will mean is you need to implement OpenID in your server. For that you need to write couple of pages in your web app, that will take care of OpenID Authentication.. then if you want your mobile users to login using OpneID, you can simple open that webpage (where you've implemented the OpenID) from within your application using some webview component or some other relevant component whatever it may be.. track user's navigation to success page to determine user is authenticated or not.
this is one way.. in other way.. there could be other ways as well..
good luck
You can check this two link :
http://developers.facebook.com/docs/mobile/android/build/
http://developer.android.com/tools/help/adb.html#directingcommands
From this two link you will get all the information for logging , sharing using facebook from your android application.