Hi Rob,
I’ve upgraded to 2100 and still the same events:
I/Corona (11601): event.name fbconnect
I/Corona (11601): event.type: session
I/Corona (11601): isError: false
I/Corona (11601): didComplete: nil
I/Corona (11601): response :
I/Corona (11601): phase : loginCancelled
I can confirm the upgrade because all the graphics were out of whack.
I’ll post my code now in the hope that you or someone else might spot something. Thanks for your time if you’re able to.
regards
Daniel
facebook.lua (the function facebookPostStartGame() gets called from another file)
facebook = require( “facebook” )
fbAppId = “188128428059002”
facebook.publishInstall(fbAppID)
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 facebookMessage = “”
function facebookListener( event )
print( “event.name”, event.name ) --“fbconnect”
print( “event.type:”, event.type ) --type is either “session”, “request”, or “dialog”
print( "isError: " … tostring( event.isError ) )
print( "didComplete: " … tostring( event.didComplete ) )
print("response : " … tostring(event.response))
print("phase : " … tostring(event.phase)) – tjn Added
--“session” events cover various login/logout events
--“request” events handle calls to various Graph API calls
--“dialog” events are standard popup boxes that can be displayed
if ( “session” == event.type ) then
if ( “login” ~= event.phase ) then
facebookAlert(“Facebook failed!”, “Please try again”)
return
end
print(access_token)
access_token = event.token
if fbCommand == GET_USER_INFO then
facebook.request(“me”)
elseif fbCommand == POST_MSG then
facebook.request(“me/feed”, “POST” , {message = message} )
end
elseif ( “request” == event.type or “dialogue” == event.type ) then
local response = event.response
print("Response: ",response)
if ( not event.isError ) then
if fbCommand == GET_USER_INFO then
response = json.decode( event.response )
elseif fbCommand == POST_MSG then
facebookAlert(“Facebook Successful”, “You’ve successfully shared your score!”)
end
else
facebookAlert(“Facebook failed!”, “Please try again”)
end
end
end
function facebookAlert(popupTitle,popupMessage)
native.showAlert( popupTitle, popupMessage, {“OK”} )
end
function postToWall(msg)
message = msg
fbCommand = POST_MSG
print(“initial login”)
– facebook.login( fbAppId, facebookListener)
– print(“logout”)
– facebook.logout()
– print(“login with permissions”)
facebook.login( fbAppId, facebookListener, {“publish_stream”} )
end
function shareGame()
message = “The Best Cricket Game Ever http://www.bestcricketgame.com”
fbCommand = POST_MSG
facebook.login( fbAppId, facebookListener, {“publish_stream”} )
end
function facebookPostStartGame()
message = “TESTING 123 PLEASE IGNORE I’ve just started The Best Cricket Game Ever. My team … " … playerTeam … " is up against " … computerTeam … “. " … tossWonBy
… " won the toss and elected to " … tostring(getTossChoice()) … " on a "
if pitchType == 1 then
message = message … " great batting wicket.”
elseif pitchType == 2 then
message = message … " pitch that will assist both batters and bowlers.”
elseif pitchType == 3 then
message = message … " great bowling wicket."
end
message = message … " The players are now off to the middle to start the action. If you’d like to play, visit http://www.bestcricketgame.com or search for ‘The Best Cricket Game Ever’ in the App Store or Google Play."
postToWall(message)
end
And my build.settings
settings =
{
iphone = {
plist = {
UIApplicationExitsOnSuspend = false,
FacebookAppID = “188128428059002”, --replace XXXXXXXXXX with your Facebook App ID
CFBundleURLTypes = {
{
CFBundleURLSchemes = { “fb188128428059002”, } --replace XXXXXXXXXX with your Facebook App ID
}
},
[“URL types”] = {
item = {
[“URL Schemes”] =
{ [“Item 0”] = “fb188128428059002” }, --replace XXXXXXXXXX with your Facebook App ID
},
},
}
},
android =
{
versionCode = “1”,
installLocation=“preferExternal”
},
androidPermissions =
{
“android.permission.READ_PHONE_STATE”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.VIBRATE”,
“android.permission.INTERNET”,
“android.permission.ACCESS_WIFI_STATE”,
“android.permission.ACCESS_FINE_LOCATION”,
“android.permission.ACCESS_COARSE_LOCATION”,
},
plugins =
{
--key is the name passed to Lua’s ‘require()’
[“CoronaProvider.native.popup.social”] =
{
--required
publisherId = “com.coronalabs”, – don’t change, is’t the publisher of the plugin
},
– key is the name passed to Lua’s ‘require()’
[“CoronaProvider.ads.admob”] =
{
– required
publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
},
– key is the name passed to Lua’s ‘require()’
[“CoronaProvider.ads.vungle”] =
{
– required
publisherId = “com.vungle”,
},
},
orientation =
{
default = “portrait”,
supported =
{
“portrait”,
},
},
}
thx
Daniel