hi,
Facebook is such dark magic to me, I wish I was a ninja at it but I’m not so appealing to those who are. I am trying to make my second Carrot integration. It seemed to work on on my other app, Gabbler, but for SevenMinutes, my fitness app, I try to ‘share’ an achievement that the user has earned using a “Share on Facebook” button. After clicking that button I see the dialog to connect to my app on FB and share the achievement but after I say ‘ok’ (the prompt to continue to allow the app to access FB’s app system) I get ‘loginFailed’ returned from FB.
Anyone encountering this issue? What gives?
I have verified that my setup seems proper. Here’s the code for my ‘share’ button:
local function postToCarrot(badge_name)
print("posting "…badge_name)
carrot.postAction(“earn”, badge_name)
local alert = native.showAlert( “Congratulations!”, “Bravo on earning a badge!”, { “OK!” }, close )
end
local function onShareButtonTouch(event)
print(“clicked share button”)
--retrieve the badge we just earned
for row in db:nrows(“SELECT * FROM workouts where id = ‘1’”) do
badge_name = row.badge
end
facebook.login(“577131645672800”, function(event)
print(event.type,event.phase)
if event.type == “session” and event.phase == “login” then
print(“event.type passed”)
carrot.validateUser(event.token)
--make sure badge_name is set
print(badge_name)
postToCarrot(badge_name)
end
end, {“publish_actions”})
end
help please! Need to update this app for Christmas!
