Hello everyone,
Yesterday I updated to build 2012.813, moving up from build 2012.776. Everything seemed to be ok.
However, it appears to have completely broken my Facebook code. Strangely, the Twitter and web service portions still function… It’s only the Facebook stuff that quit working after the update.
This is what returns in the console from the Xcode Simulator after the button is pressed:
5/14/12 5:17:58.069 PM FootballStrategy: -[IPhoneFBConnectDelegate dispatchLoginEvent:]: unrecognized selector sent to instance 0x94c1c00
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: Lua Runtime Error: lua\_pcall failed with status: 6, error message is: NSInvalidArgumentException: -[IPhoneFBConnectDelegate dispatchLoginEvent:]: unrecognized selector sent to instance 0x94c1c00
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: (
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 0 CoreFoundation 0x02edc03e \_\_exceptionPreprocess + 206
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 1 libobjc.A.dylib 0x027cfcd6 objc\_exception\_throw + 44
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 2 CoreFoundation 0x02eddcbd -[NSObject doesNotRecognizeSelector:] + 253
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 3 CoreFoundation 0x02e42ed0 \_\_\_forwarding\_\_\_ + 432
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 4 CoreFoundation 0x02e42cb2 \_CF\_forwarding\_prep\_0 + 50
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 5 FootballStrategy 0x0000c452 FootballStrategy + 46162
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 6 FootballStrategy 0x0009b237 FootballStrategy + 631351
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 7 FootballStrategy 0x00067ce2 FootballStrategy + 421090
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 8 FootballStrategy 0x0007b1b7 FootballStrategy + 500151
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 9 FootballStrategy 0x00067e5c FootballStrategy + 421468
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 10 FootballStrategy 0x0005e6f1 FootballStrategy + 382705
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 11 FootballStrategy 0x0007b66f FootballStrategy + 501359
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 12 FootballStrategy 0x00068188 FootballStrategy + 422280
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 13 FootballStrategy 0x0005e6ae FootballStrategy + 382638
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 14 FootballStrategy 0x00097818 FootballStrategy + 616472
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 15 FootballStrategy 0x0008ac77 FootballStrategy + 564343
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 16 FootballStrategy 0x0008aca9 FootballStrategy + 564393
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 17 FootballStrategy 0x0008fc8f FootballStrategy + 584847
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 18 FootballStrategy 0x0009038b FootballStrategy + 586635
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 19 FootballStrategy 0x0008fe1e FootballStrategy + 585246
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 20 FootballStrategy 0x000b4ee8 FootballStrategy + 737000
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 21 FootballStrategy 0x0001865b FootballStrategy + 95835
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 22 FootballStrategy 0x00018e70 FootballStrategy + 97904
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 23 CoreFoundation 0x02edde99 -[NSObject performSelector:withObject:withObject:] + 73
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 24 UIKit 0x01fb9c49 forwardTouchMethod + 268
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 25 UIKit 0x01fb9cb6 -[UIResponder touchesEnded:withEvent:] + 30
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 26 CoreFoundation 0x02edde99 -[NSObject performSelector:withObject:withObject:] + 73
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 27 UIKit 0x01fb9c49 forwardTouchMethod + 268
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 28 UIKit 0x01fb9cb6 -[UIResponder touchesEnded:withEvent:] + 30
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 29 UIKit 0x01ef43c0 -[UIWindow \_sendTouchesForEvent:] + 513
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 30 UIKit 0x01ef45e6 -[UIWindow sendEvent:] + 273
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 31 UIKit 0x01edadc4 -[UIApplication sendEvent:] + 464
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 32 UIKit 0x01ece634 \_UIApplicationHandleEvent + 8196
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 33 GraphicsServices 0x03225ef5 PurpleEventCallback + 1274
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 34 CoreFoundation 0x02eb0195 \_\_CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_A\_SOURCE1\_PERFORM\_FUNCTION\_\_ + 53
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 35 CoreFoundation 0x02e14ff2 \_\_CFRunLoopDoSource1 + 146
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 36 CoreFoundation 0x02e138da \_\_CFRunLoopRun + 2218
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 37 CoreFoundation 0x02e12d84 CFRunLoopRunSpecific + 212
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 38 CoreFoundation 0x02e12c9b CFRunLoopRunInMode + 123
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 39 GraphicsServices 0x032247d8 GSEventRunModal + 190
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 40 GraphicsServices 0x0322488a GSEventRun + 103
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 41 UIKit 0x01ecc626 UIApplicationMain + 1163
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 42 FootballStrategy 0x00002b0d FootballStrategy + 6925
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: 43 FootballStrategy 0x00002aa5 FootballStrategy + 6821
5/14/12 5:17:58.071 PM UIKitApplication:com.yourcompany.Football Strategy[0x682f]: )
Very intimidating block.
Here is all of the pertinent code:
social.lua
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
---------------------------------
-- FACEBOOK CONNECTIVITY OBJECTS
---------------------------------
local facebook = require("facebook")
local json = require("json")
local appId = "xxxxxxxxxxxxxxx"
-- Facebook Commands
local fbCommand -- forward reference
local LOGOUT = 1
local SHOW\_DIALOG = 2
local POST\_MSG = 3
local POST\_PHOTO = 4
local GET\_USER\_INFO = 5
local GET\_PLATFORM\_INFO = 6
local GET\_FRIEND\_INFO = 7
local GET\_USER\_PICTURE = 8
local UPLOAD\_PHOTO = 9
------------
local function printTable( t, label, level )
if label then print( label ) end
level = level or 1
if t then
for k,v in pairs( t ) do
local prefix = ""
for i=1,level do
prefix = prefix .. "\t"
end
print( prefix .. "[" .. tostring(k) .. "] = " .. tostring(v) )
if type( v ) == "table" then
print( prefix .. "{" )
printTable( v, nil, level + 1 )
print( prefix .. "}" )
end
end
end
end
----------------------------------------------------------------
local function networkListener( event )
if ( event.isError ) then
print ( "Network error - download failed" )
else
fb.alpha = 1
transition.to( fb, { alpha = 0.0 } )
display.remove( fb )
fb = display.newImageRect("fbpicture.jpg", system.DocumentsDirectory, 40, 40)
fb.x = 20;
fb.y = display.contentHeight - 20
fb.alpha = 0
transition.to( fb, { alpha = 1.0 } )
end
print ("File Directory: " .. event.response)
end
function callFacebook (event)
if ( "session" == event.type ) then
-- event.phase is one of: "login", "loginFailed", "loginCancelled", "logout"
if event.phase ~= "login" then
-- Exit if login error
return
end
-- The following displays a Facebook dialog box for posting to your Facebook Wall
if fbCommand == SHOW\_DIALOG then
facebook.showDialog({action="stream.publish"})
end
-- Request the Platform information (FB information)
if fbCommand == GET\_PLATFORM\_INFO then
facebook.request( "platform" ) -- \*\*tjn Displays info about Facebook platform
end
-- Request the current logged in user's info
if fbCommand == GET\_USER\_INFO then
facebook.request( "me" )
end
-- Request the current logged in user's friend info
if fbCommand == GET\_FRIEND\_INFO then
facebook.request( "me/friends" )
end
-- Request the current logged in user's info
if fbCommand == GET\_USER\_PICTURE then
facebook.request( "me" )
-- facebook.request( "me/friends" )
end
-- This code posts a photo image to your Facebook Wall
--
if fbCommand == POST\_PHOTO then
local attachment = {
name = "Developing a Facebook Connect app using the Corona SDK!",
link = "http://developer.anscamobile.com/forum",
caption = "Link caption",
description = "Corona SDK for developing iOS and Android apps with the same code base.",
picture = "http://developer.anscamobile.com/demo/Corona90x90.png",
actions = json.encode( { { name = "Learn More", link = "http://anscamobile.com" } } )
}
facebook.request( "me/feed", "POST", attachment ) -- posting the photo
end
-- This code posts a message to your Facebook Wall
if fbCommand == POST\_MSG then
local postMsg = {
message = "Testing Facebook with my new program!",
name="Testing Facebook with my new program!",
caption="Testing Facebook with my new program!",
--link="URL LINK HERE",
--picture="URL LINK HERE"
}
facebook.request( "me/feed", "POST", postMsg ) -- posting the message
end
-- This code uploads a photo to Facebook
if fbCommand == UPLOAD\_PHOTO then
local photoUpload = {
message = "Testing Facebook with my new program!",
source = { baseDir=system.ResourceDirectory, filename="fb.png", type="image"}
}
facebook.request( "me/photos", "POST", photoUpload ) -- uploading the photo
end
-----------------------------------------------------------------------------------------
elseif ( "request" == event.type ) then
-- event.response is a JSON object from the FB server
response = event.response
if ( not event.isError ) then
response = json.decode( event.response )
data = response.data
if fbCommand == GET\_USER\_INFO then
printTable( response, "User Info", 3 )
print( "Full Name: ", response.name )
elseif fbCommand == POST\_PHOTO then
printTable( response, "photo", 3 )
elseif fbCommand == POST\_MSG then
printTable( response, "message", 3 )
elseif fbCommand == UPLOAD\_PHOTO then
printTable( response, "photo", 3 )
elseif fbCommand == GET\_FRIEND\_INFO then
for i=1,#data do
print ( data[i].name )
print ( "User " .. i .. ": " .. data[i].id )
print ( " " )
end
elseif fbCommand == GET\_USER\_PICTURE then
print( "Requesting user's profile picture." )
network.download( "http://graph.facebook.com/" .. response.id .. "/picture", "GET", networkListener, "fbpicture.jpg", system.DocumentsDirectory )
-- data[i].id
else
-- Unknown command response
print( "Unknown command response" )
end
else
-- Post Failed
printTable( event.response, "Post Failed Response", 3 )
end
elseif ( "dialog" == event.type ) then
-- showDialog response
--
print( "dialog response:", event.response )
end
end
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
build.settings
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
"fbxxxxxxxxxxxxxxx",
}
}
}
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
menu.lua
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
local facebookLoginRelease = function ( event )
print("facebookLoginRelease")
print(" ")
fbCommand = GET\_USER\_PICTURE
facebook.login( appId, callFacebook, {"publish\_stream"} )
end
---------------------------------------------------------
-- Surrounding code... ----------------------------------
---------------------------------------------------------
Any help would be greatly appreciated! If there is anything missing, please let me know.
Thank you for your time,
Paul [import]uid: 3027 topic_id: 26315 reply_id: 326315[/import]