Impossible to reinstate Facebook access after revoking

I have a strange problem with Facebook and Corona.

  1. I run my Corona app with facebook.login(myAppId, listener, {“publish_stream”}). The Facebook app comes up and lets me click to accept the app to connect to Facebook. The listener makes subsequent facebook calls for “me”, “me/friends”, etc. Everything works perfectly.

  2. I log on to Facebook from my computer, go to “My apps” and revoke the access for my app.

  3. I repeat step 1. However, rather than asking me to approve the app for Facebook again, the Facebook API simply fails.

First the Facebook listener gets this response:

type = “request”,
name = “fbconnect”,
didComplete = “false”,
isError = “false”,
response = “{“error”:{“message”:“Error validating access token: User *** has not authorized application ***.”,“type”:“OAuthException”,“code”:190,“error_subcode”:458}}”,

Then this:

type = “request”,
name = “fbconnect”,
didComplete = “false”,
isError = “true”,
response = “The operation couldn’t be completed. (facebookErrDomain error 10000.)”,

Now the scary part is that nothing can “reset” this state. Killing and restarting the app changes nothing. Not even removing the Facebook app or clearing out Safari removes the problem. (Luckily, the initial “Approve app for Facebook” page still resided in Safari, so by going back there and pressing “Accept” again, my app could access Facebook again).

Does anyone know how to fix things so that Corona/Facebook simply asks for access again if access is revoked, rather than just failing?

[import]uid: 73434 topic_id: 31963 reply_id: 331963[/import]

I had this happen to me on one of my apps, the only way I could get it to ask again was to delete my app and reinstall.

Dave [import]uid: 117617 topic_id: 31963 reply_id: 127439[/import]

Hi, I’m not sure this will solve your problem, but we’re actually doing a logout automatically when Corona’s (horrible) Facebook handlig fails. Something like this:

[code]
if (“session” == event.type) then
if event.phase ~= “login” then
return false
end

if fbCommand == POST_MSG then
facebook.request(“me/feed”, “POST”, fbData)
end


elseif “request” == event.type then
if not event.isError then
local response = json.decode(event.response)
if response then
if fbCommand == POST_MSG then
– Do stuff
end
end


else
– Error
fbCommand = nil
facebook.logout()
end
end
end
[/code] [import]uid: 21746 topic_id: 31963 reply_id: 127464[/import]

I had this happen to me on one of my apps, the only way I could get it to ask again was to delete my app and reinstall.

Dave [import]uid: 117617 topic_id: 31963 reply_id: 127439[/import]

Running facebook.logout() on failures did the trick.

Corona employees: If you are reading this, you should update your API to ask the user to log into Facebook again if access is revoked, rather than failing with irrecoverable errors.
[import]uid: 73434 topic_id: 31963 reply_id: 127603[/import]

Hi, I’m not sure this will solve your problem, but we’re actually doing a logout automatically when Corona’s (horrible) Facebook handlig fails. Something like this:

[code]
if (“session” == event.type) then
if event.phase ~= “login” then
return false
end

if fbCommand == POST_MSG then
facebook.request(“me/feed”, “POST”, fbData)
end


elseif “request” == event.type then
if not event.isError then
local response = json.decode(event.response)
if response then
if fbCommand == POST_MSG then
– Do stuff
end
end


else
– Error
fbCommand = nil
facebook.logout()
end
end
end
[/code] [import]uid: 21746 topic_id: 31963 reply_id: 127464[/import]

Running facebook.logout() on failures did the trick.

Corona employees: If you are reading this, you should update your API to ask the user to log into Facebook again if access is revoked, rather than failing with irrecoverable errors.
[import]uid: 73434 topic_id: 31963 reply_id: 127603[/import]

Ug… same here. [import]uid: 5942 topic_id: 31963 reply_id: 132392[/import]

Ug… same here. [import]uid: 5942 topic_id: 31963 reply_id: 132392[/import]