Is it possible to post a message on somebody’s Facebook wall in the BACKGROUND?
Like without flipping between your app and Safari 3 times, which is very annoying for the user?
Is it possible to post a message on somebody’s Facebook wall in the BACKGROUND?
Like without flipping between your app and Safari 3 times, which is very annoying for the user?
Once the user has logged in to facebook and has requested the necessary write permissions. Each of these should do a fast switch to the native facebook app. After that it should not need to login unless they logout or you call the login procedure again.
If you’re getting safari windows, then it sounds like you’re not setup correctly to use the native facebook app, or you do not have it installed.
Rob
I am logged in, and permissions are set. It still takes at least 5 secs. The plugin flips to facebook twice, and the whole thing takes around 5 secs. I was just wandering, since the permissions are set, why can’t it be posted in the background instead. It’s confusing for the user, and i’m sure the next time he/she don’t want to share again. It’s already hard to convince a user to share something on fb
We will need to see some code. Your build.settings will be important for us to see. Do you have the native facebook app installed? What version of Corona SDK are you building with?
I got native Facebook app installed. Using Corona 2014.2511.
build.settings:
settings = { plugins = { ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, }, ["plugin.playhaven"] = { publisherId = "com.playhaven", }, ["plugin.tapfortap"] = { publisherId = "com.tapfortap", }, ["facebook"] = { publisherId = "com.coronalabs" }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", }, }, iphone = { plist = { UIAppFonts = { "SaranaiGame-Bold.ttf" }, UIApplicationExitsOnSuspend = false, FacebookAppID = "1588028748098867", --replace XXXXXXXXXX with your Facebook App ID CFBundleURLTypes = { { CFBundleURLSchemes = { "fb1588028748098867", } } --replace XXXXXXXXXX with your Facebook App ID }, UIStatusBarHidden=true, }, }, android = { usesPermissions = { "com.android.vending.BILLING", googlePlayGamesAppId = "123456789012", }, }, }
Facebookhelper module is pretty straighforward
Using it like:
local facebookHelper = require “facebookHelper”;
facebookHelper.postBigWin()
local facebook = require "facebook"; local json = require "json"; local facebookHelper = {}; local appID = "1588028748098867"; facebookHelper.postOnUserWall = function(message) native.setActivityIndicator(true); local listener; listener = function(event) if ( "session" == event.type ) then if ( "login" == event.phase ) then local postMsg = { message = "Playing Golden Slots Treasure on my iPhone/iPad! \n\nLine 2 Type something here!\n\nLine 3 also\n\n", link="https://itunes.apple.com/us/app/golden-slots-treasure/id944248004?mt=8", --picture = "http://ragdogstudios.com/wp-content/uploads/2014/02/flappy\_thumb.png", description = "Get the Flappy Bird Template for Corona SDK and learn how to make one of the biggest hits currently on the stores!", --link = "http://bit.ly/1eDPypU", name = "Golden Slots", caption = "Play Golden Slots Treasure!" }; facebook.request( "me/feed", "POST", postMsg ) native.setActivityIndicator(true); end elseif ("request" == event.type) then local respTab = json.decode(event.response); native.setActivityIndicator(false); if respTab then native.showAlert("Success", "Message successfuly posted!", {"OK"}); end end native.setActivityIndicator(nil); end facebook.login(appID, listener, {"publish\_actions"}); end facebookHelper.postBigWin = function(message) native.setActivityIndicator(true); local listener; listener = function(event) if ( "session" == event.type ) then if ( "login" == event.phase ) then local postMsg = { message = "I just won "..tostring(ThisWin).." credits with Golden Slots Treasure!", link="https://itunes.apple.com/us/app/golden-slots-treasure/id944248004?mt=8", --picture = "http://ragdogstudios.com/wp-content/uploads/2014/02/flappy\_thumb.png", --description = "Get the Flappy Bird Template for Corona SDK and learn how to make one of the biggest hits currently on the stores!", --link = "http://bit.ly/1eDPypU", name = "Golden Slots", caption = "Play Golden Slots Treasure!" }; facebook.request( "me/feed", "POST", postMsg ) native.setActivityIndicator(true); end elseif ("request" == event.type) then local respTab = json.decode(event.response); native.setActivityIndicator(false); if respTab then native.showAlert("Success", "Message successfuly posted!", {"OK"}); end end native.setActivityIndicator(nil); end facebook.login(appID, listener, {"publish\_actions"}); end return facebookHelper;
Once the user has logged in to facebook and has requested the necessary write permissions. Each of these should do a fast switch to the native facebook app. After that it should not need to login unless they logout or you call the login procedure again.
If you’re getting safari windows, then it sounds like you’re not setup correctly to use the native facebook app, or you do not have it installed.
Rob
I am logged in, and permissions are set. It still takes at least 5 secs. The plugin flips to facebook twice, and the whole thing takes around 5 secs. I was just wandering, since the permissions are set, why can’t it be posted in the background instead. It’s confusing for the user, and i’m sure the next time he/she don’t want to share again. It’s already hard to convince a user to share something on fb
We will need to see some code. Your build.settings will be important for us to see. Do you have the native facebook app installed? What version of Corona SDK are you building with?
I got native Facebook app installed. Using Corona 2014.2511.
build.settings:
settings = { plugins = { ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, }, ["plugin.playhaven"] = { publisherId = "com.playhaven", }, ["plugin.tapfortap"] = { publisherId = "com.tapfortap", }, ["facebook"] = { publisherId = "com.coronalabs" }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", }, }, iphone = { plist = { UIAppFonts = { "SaranaiGame-Bold.ttf" }, UIApplicationExitsOnSuspend = false, FacebookAppID = "1588028748098867", --replace XXXXXXXXXX with your Facebook App ID CFBundleURLTypes = { { CFBundleURLSchemes = { "fb1588028748098867", } } --replace XXXXXXXXXX with your Facebook App ID }, UIStatusBarHidden=true, }, }, android = { usesPermissions = { "com.android.vending.BILLING", googlePlayGamesAppId = "123456789012", }, }, }
Facebookhelper module is pretty straighforward
Using it like:
local facebookHelper = require “facebookHelper”;
facebookHelper.postBigWin()
local facebook = require "facebook"; local json = require "json"; local facebookHelper = {}; local appID = "1588028748098867"; facebookHelper.postOnUserWall = function(message) native.setActivityIndicator(true); local listener; listener = function(event) if ( "session" == event.type ) then if ( "login" == event.phase ) then local postMsg = { message = "Playing Golden Slots Treasure on my iPhone/iPad! \n\nLine 2 Type something here!\n\nLine 3 also\n\n", link="https://itunes.apple.com/us/app/golden-slots-treasure/id944248004?mt=8", --picture = "http://ragdogstudios.com/wp-content/uploads/2014/02/flappy\_thumb.png", description = "Get the Flappy Bird Template for Corona SDK and learn how to make one of the biggest hits currently on the stores!", --link = "http://bit.ly/1eDPypU", name = "Golden Slots", caption = "Play Golden Slots Treasure!" }; facebook.request( "me/feed", "POST", postMsg ) native.setActivityIndicator(true); end elseif ("request" == event.type) then local respTab = json.decode(event.response); native.setActivityIndicator(false); if respTab then native.showAlert("Success", "Message successfuly posted!", {"OK"}); end end native.setActivityIndicator(nil); end facebook.login(appID, listener, {"publish\_actions"}); end facebookHelper.postBigWin = function(message) native.setActivityIndicator(true); local listener; listener = function(event) if ( "session" == event.type ) then if ( "login" == event.phase ) then local postMsg = { message = "I just won "..tostring(ThisWin).." credits with Golden Slots Treasure!", link="https://itunes.apple.com/us/app/golden-slots-treasure/id944248004?mt=8", --picture = "http://ragdogstudios.com/wp-content/uploads/2014/02/flappy\_thumb.png", --description = "Get the Flappy Bird Template for Corona SDK and learn how to make one of the biggest hits currently on the stores!", --link = "http://bit.ly/1eDPypU", name = "Golden Slots", caption = "Play Golden Slots Treasure!" }; facebook.request( "me/feed", "POST", postMsg ) native.setActivityIndicator(true); end elseif ("request" == event.type) then local respTab = json.decode(event.response); native.setActivityIndicator(false); if respTab then native.showAlert("Success", "Message successfuly posted!", {"OK"}); end end native.setActivityIndicator(nil); end facebook.login(appID, listener, {"publish\_actions"}); end return facebookHelper;