Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Integrate Facebook with mine app — Gideros Forum

Integrate Facebook with mine app

pedroluis5pedroluis5 Member
edited April 2013 in General questions
Hi guys again heheheh

a try to integrate facebook on my app IOS

i using this example of @ar2rsawseen

require "facebook"

facebook:addEventListener(Event.LOGIN_COMPLETE, function()
print("login successful")
facebook:extendAccessTokenIfNeeded()
end)

facebook:setAppId("352852401492555");
facebook:authorize();

local text = TextField.new(nil, "post to wall")
text:setScale(3)
text:setPosition(10, 50)
stage:addChild(text)
text:addEventListener(Event.TOUCHES_BEGIN, function(e)
if text:hitTestPoint(e.touch.x, e.touch.y) and facebook:isSessionValid() then
facebook:dialog("feed", {
link = "http://giderosmobile.com",
picture = "http://www.giderosmobile.com/wp-content/uploads/2012/06/gideros-mobile-small.png",
name = "GiderosMobile.com",
caption = "Awesome tool",
description = "Check out this awesome product"
})
end
end)

local text2 = TextField.new(nil, "Make api request")
text2:setScale(3)
text2:setPosition(10, 150)
stage:addChild(text2)
text2:addEventListener(Event.TOUCHES_BEGIN, function(e)
if text2:hitTestPoint(e.touch.x, e.touch.y) and facebook:isSessionValid() then
facebook:graphRequest("me")
end
end)

facebook:addEventListener(Event.REQUEST_COMPLETE, function(e)
print(e.response)
end)

facebook:addEventListener(Event.REQUEST_ERROR, function(e)
print(e.errorDescription)
end)

I export this to xcode and configure all like this video below, and the steps in manual reference of gideros
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/

but when run this erro below happen...I need to add something more in xcode project or gideros project?

assets/main.lua:1: module 'facebook' not found:
no field package.preload['facebook']
no file './facebook.lua'
no file '/usr/local/share/lua/5.1/facebook.lua'
no file '/usr/local/share/lua/5.1/facebook/init.lua'
no file '/usr/local/lib/lua/5.1/facebook.lua'
no file '/usr/local/lib/lua/5.1/facebook/init.lua'
no file './facebook.so'
no file '/usr/local/lib/lua/5.1/facebook.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
/Users/pedronascimento/Documents/01-Projetos/xcode/Facebook/Facebook/assets/main.lua:1: in main chunk

Comments

  • See my solution in this thread: http://www.giderosmobile.com/forum/discussion/comment/19372#Comment_19372

    You may have the same issue. Basically the Facebook SDK is not correctly setup in XCode so Gideros can't find it.
    [ Twitter: pushpoke | Facebook: facebook.com/pushpoke | Web: pushpoke.com | Letter Stack iOS: letterstack.com ]
  • @krisis i follow the steps that you told.. and work now.... i so harry :D

    OK, I managed to figure out the issue. Although I had added the files in step 5 to my project, I had to also add them to the compile sources:
    - add facebookbinder.cpp and gfacebook-ios.mm to the Build Phases > Compile Sources

    :D
  • @ar2rsawseen I add the facebook feature on gideros player and work very well.
    If someone need i can upload xcode project of giderosplayer.

  • when i use this

    facebook:graphRequest("me/picture?redirect=false")

    this return a url of my picture. How can i make this url a bitmap?

    att
  • @amaximov
    @pedroluis5

    After I make the request
    facebook:graphRequest("me/picture")
    How can I save the picture's url into a variable in order to later use urlloader?
    Because both of this methods print a gigantic string with weird characters and symbols.
    facebook:addEventListener(Event.REQUEST_COMPLETE, function(e)
    	print(e.response)
    end
    facebook:addEventListener(Event.REQUEST_COMPLETE, function(e)
    	local data = Json.Decode(e.response)
     
    	for i = 1, #data["data"] do
    		print(data["data"][i])
    	end
    end
Sign In or Register to comment.