I am getting the same issue, where it takes me to Facebook to post, but does not post. This is using build 2012.894. When trying to post with build 2012.1076, it doesn’t even go to Facebook.
Here is the Facebook controller code, whose externally facing functions (at the bottom) are called by any function needing Facebook functionality. The Facebook configuration on FB’s side configuration is exactly the same as Rob Miracle’s above.
[lua]
module(…, package.seeall)
facebookControllerInstance = nil
function facebook_controller:getFacebookControllerInstance()
if facebookControllerInstance then
return facebookControllerInstance
end
local facebook = require “facebook”
require “facebook_meta”
facebookControllerInstance = {}
local JSON = require(“JSON”)
local appId = facebook_meta[“appID”]
local apiKey = facebook_meta[“apiKey”]
local appLink
local deviceOS = system.getInfo(“platformName”)
if deviceOS == “iPhone OS” then
appLink = facebook_meta[“iOS”]
else
appLink = facebook_meta[“Android”]
end
local fbCommand
local POST_MSG = 1
local GET_USER_INFO = 2
local postLevelAch = true
local postMainAch = false
local postAmmoAch = false
local achInfo = {}
local wallData, userData
local function getMessageInfo()
if postLevelAch then
wallData.caption = userData.name … facebook_meta[“level_part1”] … achInfo.score … facebook_meta[“level_part2”] … achInfo.level … facebook_meta[“level_part3”]
wallData.picture = facebook_meta[“achievement_image”]
elseif postMainAch then
wallData.caption = userData.name … facebook_meta[“achievement_part1”] … achInfo.giftName … facebook_meta[“achievement_part2”]
wallData.picture = facebook_meta[“achievement_image”]
elseif postAmmoAch then
wallData.caption = userData.name … " won an " … achInfo.giftName … facebook_meta[“level_part3”]
wallData.picture = facebook_meta[“achievement_image”]
else
wallData.caption = userData.name … facebook_meta[“chapter_part1”] … achInfo.chapter … facebook_meta[“chapter_part2”]
wallData.picture = facebook_meta[“achievement_image”]
end
end
local function fbListener( event )
if event.type == “session” then
if event.phase == “login” then
if fbCommand == POST_MSG then
getMessageInfo()
facebook.request(“me/feed”, “POST”, wallData)
native.showAlert(“Achievement Shared!”, “Your achievement has been successfully posted to Facebook!”, {“OK”})
elseif fbCommand == GET_USER_INFO then
facebook.request(“me”)
end
end
elseif event.type == “request” then
if event.isError then return end
local response = event.response
if fbCommand == GET_USER_INFO then
userData = JSON:decode(response)
getMessageInfo()
fbCommand = POST_MSG
facebook.login(appId, fbListener, {“publish_stream”})
end
end
end
local function callWallPost()
wallData = {
name = facebook_meta[“app_name”],
link = appLink,
actions = JSON:encode({name = facebook_meta[“app_name”], link = appLink})
}
if userData then
fbCommand = POST_MSG
else
fbCommand = GET_USER_INFO
end
facebook.login(appId, fbListener, {“publish_stream”})
end
facebookControllerInstance.postLevelAchievement = function(self, level, score)
achInfo.level = level
achInfo.score = score
callWallPost()
end
facebookControllerInstance.postMainAchievement = function(self, giftName, giftImage)
postLevelAch = false
postMainAch = true
achInfo.giftName = giftName
achInfo.giftImage = giftImage
callWallPost()
end
facebookControllerInstance.postAmmoAchievement = function(self)
postLevelAch = false
postAmmoAch = true
achInfo.giftName = “an ammo pack”
achInfo.giftImage = “ui_ammo_icon”
callWallPost()
end
facebookControllerInstance.postChapterAchievement = function(self, chapter)
postLevelAch = false
achInfo.chapter = chapter
callWallPost()
end
return facebookControllerInstance
end
[/lua]
And here is build.settings
[lua]
settings =
{
androidPermissions =
{
“android.permission.VIBRATE”,
“android.permission.INTERNET”,
“com.android.vending.BILLING”,
“android.permission.READ_PHONE_STATE”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.ACCESS_WIFI_STATE”
},
orientation =
{
default = “landscapeRight”,
supported =
{
“landscapeRight”,
},
},
iphone =
{
plist=
{
UIApplicationExitsOnSuspend = false,
UIStatusBarHidden=true,
UIPrerenderedIcon = true,
FacebookAppID = “XXXXXXXXXXXX” [ID stripped from this forum for security]
CFBundleIdentifier = “something.something.something” [ID stripped from this forum for security]
CFBundleDisplayName = “App Name” [ID stripped from this forum for security]
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXXXXXX”, [ID stripped from this forum for security]
CFBundleIconFile = “Icon.png”,
}
}
},
CFBundleIconFiles = {
“Icon.png” ,
“Icon@2x.png” ,
“Icon-72.png” ,
},
UIAppFonts =
{
[fonts used — stripped from this forum post]
},
},
components = {}
}
}
[/lua]