I’ve been looking at some examples on how to use facebook in your games, however most of the sample is on how to post score to your wall and I was looking for how to display my wall posts.
I’m pretty new at this so I took the tabBar sample and made a new module that would show my wall posts in one of the tabs.
I’m not sure on how to proceed further, I started out with a webView but that showed my entire profile and that was not what I had in mind. So I was thinking if I could add my wall post to a widget scrollView?
I thought this would be a fun thing to share with my friends since I don’t have a website or a blog so they could get my app instead.
After reading about FB graphs, that honestly didn’t make no sense to me. I did figured out I need to create an appID etc and so I did. FB uses json so I required that since it’s built into corona.
So now I have my appID, appSecret and a nameSpace. But what is an accessToken?
“https://graph.facebook.com/me/feed?access_token=” Should I put my appID here?
I would be very thankful if anyone could help me out with this…
module(..., package.seeall)
local facebook = require("facebook")
local json = require("json")
local widget = require("widget")
function new()
local g = display.newGroup()
local background
local myScrollView = widget.newScrollView
local myAppID = "123456789"
background = display.newRect(0, 0, 320, 480)
background:setFillColor(255, 255, 255)
g:insert(background)
myScrollView = newScrollView{
x = 0,
y = 0,
width = 320 ,
height = 480,
}
g:insert(myScrollView.view)
facebook.login(myAppId, fbListener)
local function = fbListener(event)
if("session" == event.type) then
if("login" == event.phase) then
facebook.request("me/feed", "GET")
end
end
end
function g:cleanUp()
g:removeSelf();
g = nil;
print("cleaning");
end
return g
end
[import]uid: 65840 topic_id: 16161 reply_id: 316161[/import]