Я хочу поделиться случайным счетом моего приложения на facebook. Каждый раз, когда я запускаю приложение, я вхожу в fb успешно, но приложение показывает ошибку. Вот моя функция прослушивателя, вызванная на facebook.login. Выполняется инструкция Else вместо оператора if (isAvailable). Я смотрел все в интернете, но все равно проигрывал.Как делиться или публиковать игровой счет на стене лицевой стены для устройств Android с помощью инструмента Corona SDK?
function listener (event)
local serviceName = "facebook" --supported values are "twitter", "facebook", or "sinaWeibo"
local isAvailable = native.canShowPopup("social", serviceName)
if (isAvailable) then --- does not execute this statement
local function networkListener(event)
if (event.isError) then
print("Network error: ", event.response)
else
print ("RESPONSE: " .. event.response)
end
end
accessTokenFromFacebookLogin = facebook.getCurrentAccessToken(); --- gets token of current fb user
facebookUserId = facebook.request("me", "GET", { field = "id" }); --- gets all the data of user in this case user id
local params = {};
params.body = "&score="..tostring(newScore).."&access_token="..accessTokenFromFacebookLogin;
network.request("https://graph.facebook.com/"..facebookUserId.."/scores", "POST", networkListener, params); --- post the score on desired user id's feed or something
else --- shows this msg instead of executing if statement :(
native.showAlert(
"Cannot post " .. serviceName .. " score.",
"Please setup your " .. serviceName .. " account or check your network connection.",
{ "OK" })
end
end
Пожалуйста, помогите мне решить эту проблему. Любая помощь будет высоко ценится. Спасибо.