Facebook Wall Posts displays on iPhone App
I am creating an iPhone app in Titanium Developer. i want to get the facebook wall posts from a facebook fan page
so when you click the tab to show facebook wall posts(status updates) i want them to be displayed as rows/lists.
does any one know how to do that?
6 Answers
-
Hi there, did you solve this? i am getting it from RSS but i don't want to do like that, have you got any solution?
-
Thank you very much, i will try it, and do you know any image gallery that can be work fast in the app, i am using Codeboxed image gallery with remote images but it seems very slow:( do know something different, with thumbs and big images. Thanks
-
i have figured the flickr and get my id and appkey, i think i do it right:) as you sad how can make this with the addEventListener, i want when user touch the thumbnail it will load the big image like the codeboxed gallery?
-
see this page: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.ScrollableView-object
instead of loading in your image in a single imageView. load in the array of imageViews into a scrollableView.
// this is the scrollable view to flick my images var slideView = Titanium.UI.createScrollableView({ views:photo, cacheSize:5, currentPage:0, showPagingControl:false, top:0, width:320 });
Then you should add in this
slideView.addView(photo[i]);
To your for loop to add the images to the slideView. -
Thanks for your help very much, i am still trying if i can do this i will put the code in here.
can i ask you another image question?while i am using a facebook graph api with this
http://graph.facebook.com/ALBUM_ID/photos/
it really gives the images, but when i want to pull this with this xhr code doesn't load
do you know something about this?var xhr_request = Titanium.Network.createHTTPClient( ); xhr_request.setTimeout(5000); xhr_request.onerror = function(e){ alert('You have an internet Connection Problem'); } xhr_request.open("GET", 'http://graph.facebook.com/ALBUM_ID/photos/'); xhr_request.onload = function(){ try{ json_data = eval('('+this.responseText+')'); displayImages( ); win.remove( actInd ); }catch(e){ alert('Be sure that you have an internet connection'); } } xhr_request.send( );
-
Sure, you need to call the "feed" endpoint on Facebook's graph API. The code below will show you how to hit a users feed and return some data, I gave you a head start with some XML parsing, but you can expand how you like. An easy way to see all the returned data options is to visit Facebook's API docs, or play around in the Facebook Explorer.
Im assuming you have a proper access token to retrieve data in the example, otherwise only public data will be returned. Also, you may use "me" as a username to return the data for a user that is already authorized.
var id = []; var message = []; var description = []; var link = []; var createdAt = []; var type = []; var xhr = Ti.Network.createHTTPClient(); xhr.setTimeout(5000); xhr.open("GET","https://graph.facebook.com/UNIQUE USER NAME OR PROFILE ID/feed?access_token=YOUR ACCESS TOKEN"); xhr.onerror = function(e) { alert('Oh Dear, There was a problem with Facebook\n\n'+e.error); }; xhr.onload = function() { //lets parse the return data and iterate through, you can display how you like doc = JSON.parse(this.responseText); for (var i = 0; i<doc.data.length; i++) { id[i] = doc.data[i].id; message[i] = doc.data[i].message; description[i] = doc.data[i].description; link[i] = doc.data[i].link; type[i] = doc.data[i].type; createdAt[i] = doc.data[i].created_time; } }