2 facebook issues

Was just about to submit an update to apple when I thought that I would just test the social buttons I have on my app, good job I did as neither of the Facebook buttons I have work at all.

the 1st button is a basic one that takes the user to my Facebook page

 local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) system.openURL( "https://www.facebook.com/mypage" ) end end

the issue with this one is that when I have the Facebook app installed it just takes me to my timeline rather than than my business page. when I uninstall the Facebook app it opens up Safari and goes to the current page. I’m assuming Facebook have changed something in their app that is stopping linking like this from working, is there a solution to this??

the 2nd button (the one thats more important to get working) is so the users can post their scores from my app to their timeline.

I have the following in my build.settings

 iphone = { plist = { UIApplicationExitsOnSuspend = false, FacebookAppID = "XXXXXXXXXXXXXXX", CFBundleURLTypes = { { CFBundleURLSchemes = {"fbXXXXXXXXXXXXXXX",} } } } }

and then the following in my main.lua file

 local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) -- listener for "fbconnect" events local function listener( event ) if ( "session" == event.type ) then -- upon successful login, request list of friends if ( "login" == event.phase ) then facebook.showDialog( "feed", { message="my message", name="some info", caption="my caption", link="line to the iTunes store", picture="link to picture" }) end elseif ( "dialog" == event.type ) then print( event.response ) end end -- first argument is the app id that you get from Facebook facebook.login( "XXXXXXXXXXXXXXX", listener ) end end

when you click the button, it asks for me to login in and then gives me an error message of “An error occurred. Please try again later.”

You then click the ‘okay’ button and it then says “Invalid App ID. The provided app ID is invalid”

I was using version 2013.1202 (2013.8.28) originally and everything worked fine, but with having to move to 2014.1262 (2014.1.28) its now stopped and I can’t get it started again

any help would be great, I was literally 2 minutes away from submitting my update before this all screwed up!!!

regarding issue 2. I’ve found that if I change my code to the following I can post to facebook

 local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) -- listener for "fbconnect" events local function facebookListener( event ) if ( "session" == event.type ) then -- upon successful login, request list of friends if ( "login" == event.phase ) then local msg = { name="some info", caption="my caption", -- sub line of text here link="link", picture="icon.png" } facebook.request( "me/feed", "POST", msg ) end end end local fbAppID = "XXXXXXXXXXXXXXXXXX" --replace with your Facebook App ID facebook.login( fbAppID, facebookListener, { "publish\_actions" } ) end end

however the first time a users tries to post a score to Facebook they have to click the button 3 times

first time they click the button they get the following message - “App Name” would like to access your basic profile info and list of friends.

they then have to click ok

then they need to click the button again, this time they get the message - “App Name” would like to post publicly on your behalf.

they then have to click ok again

then they have to click a third time to actually post to facebook (and they can spam post by hitting the button multiple times)

at no time does any popups/dialogues appear to tell them that they need to press the button again - this doesn’t seem right to me, I must be missing something???

is anyone able to help???

this is stopping me from releasing the update of my app!

Is there any way to get between the 2 Facebook popups 

“App Name” would like to access your basic profile info and list of friends.

and

“App Name” would like to post publicly on your behalf.

 

and add a popup of my own or is it possible to combine the ok click of both of them together??

 

when the user clicks ok the first time they have no way of knowing that they need to press the button again to get the second popup before their message will be posted. This seems like a major flaw on Facebook/corona

 

 

also why if I have the Facebook app installed does this not work and take me to the correct page??

local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) system.openURL( "https://www.facebook.com/mypage" ) end end

if I uninstall the app it works just fine???

I don’t have any suggestions on the 1st issue.  The operating system is intercepting the URL and redirecting it to the Facebook app.

As for the 2nd issue, this is unfortunately how Facebook wants things done.  If you were a Pro subscriber, you could use the social plugin where you would just get one popup screen in a much simpler to implement method than using the facebook API.  Since you have to use the Facebook API, Facebook wants a login with no permissions requested.  Then later, when you actually need to do the write, you ask for your extended permissions.  We’ve tried to combine that into one step, but it can lead to issues like this.  However, I don’t know why your code isn’t posting after the 2nd dialog box goes away.

The problem with the social plugin tho is that it gives the app user the ability to edit the text and images in the dialog, this is no good for me as I’m using it to post scores to facebook. I don’t want to allow the user to edit there score

Have been thinking about it all day and I might upgrade to Pro just to get this over and done with

3 quick questions tho

  1. using the social plugin is it possible to take screen capture and post that to Facebook?? Something along these lines…

    local function onFaceTouch( event ) local screenCap = display.captureScreen( ) – Show the popup native.showPopup( social, { service = “facebook”, message = “I scored 25 points”, image = { { filename = screenCap }, }, }) end

of course this is just guess work on my part as I don’t have the ability to test this code

  1. Just to double check but the social plugin is compatible with build 1262 isn’t it??

  2. It is possible to upgrade from a Basic account (my business uses a different username, this is my personal one) to Pro account isn’t it without paying the full price (i.e. I just pay the difference between the Basic Sub and the Pro Sub??)

  1. You should be able to do something like that.  You will need to capture the photo to a file, not a display object like that, then read the photo back in.

  2. It should be compatible with 1262.

  3. Yes, they pro-rate your subscription.

Rob

regarding issue 2. I’ve found that if I change my code to the following I can post to facebook

 local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) -- listener for "fbconnect" events local function facebookListener( event ) if ( "session" == event.type ) then -- upon successful login, request list of friends if ( "login" == event.phase ) then local msg = { name="some info", caption="my caption", -- sub line of text here link="link", picture="icon.png" } facebook.request( "me/feed", "POST", msg ) end end end local fbAppID = "XXXXXXXXXXXXXXXXXX" --replace with your Facebook App ID facebook.login( fbAppID, facebookListener, { "publish\_actions" } ) end end

however the first time a users tries to post a score to Facebook they have to click the button 3 times

first time they click the button they get the following message - “App Name” would like to access your basic profile info and list of friends.

they then have to click ok

then they need to click the button again, this time they get the message - “App Name” would like to post publicly on your behalf.

they then have to click ok again

then they have to click a third time to actually post to facebook (and they can spam post by hitting the button multiple times)

at no time does any popups/dialogues appear to tell them that they need to press the button again - this doesn’t seem right to me, I must be missing something???

is anyone able to help???

this is stopping me from releasing the update of my app!

Is there any way to get between the 2 Facebook popups 

“App Name” would like to access your basic profile info and list of friends.

and

“App Name” would like to post publicly on your behalf.

 

and add a popup of my own or is it possible to combine the ok click of both of them together??

 

when the user clicks ok the first time they have no way of knowing that they need to press the button again to get the second popup before their message will be posted. This seems like a major flaw on Facebook/corona

 

 

also why if I have the Facebook app installed does this not work and take me to the correct page??

local onFaceTouch = function( event ) if event.phase == "release" then audio.play( clickSound ) system.openURL( "https://www.facebook.com/mypage" ) end end

if I uninstall the app it works just fine???

I don’t have any suggestions on the 1st issue.  The operating system is intercepting the URL and redirecting it to the Facebook app.

As for the 2nd issue, this is unfortunately how Facebook wants things done.  If you were a Pro subscriber, you could use the social plugin where you would just get one popup screen in a much simpler to implement method than using the facebook API.  Since you have to use the Facebook API, Facebook wants a login with no permissions requested.  Then later, when you actually need to do the write, you ask for your extended permissions.  We’ve tried to combine that into one step, but it can lead to issues like this.  However, I don’t know why your code isn’t posting after the 2nd dialog box goes away.

The problem with the social plugin tho is that it gives the app user the ability to edit the text and images in the dialog, this is no good for me as I’m using it to post scores to facebook. I don’t want to allow the user to edit there score

Have been thinking about it all day and I might upgrade to Pro just to get this over and done with

3 quick questions tho

  1. using the social plugin is it possible to take screen capture and post that to Facebook?? Something along these lines…

    local function onFaceTouch( event ) local screenCap = display.captureScreen( ) – Show the popup native.showPopup( social, { service = “facebook”, message = “I scored 25 points”, image = { { filename = screenCap }, }, }) end

of course this is just guess work on my part as I don’t have the ability to test this code

  1. Just to double check but the social plugin is compatible with build 1262 isn’t it??

  2. It is possible to upgrade from a Basic account (my business uses a different username, this is my personal one) to Pro account isn’t it without paying the full price (i.e. I just pay the difference between the Basic Sub and the Pro Sub??)

  1. You should be able to do something like that.  You will need to capture the photo to a file, not a display object like that, then read the photo back in.

  2. It should be compatible with 1262.

  3. Yes, they pro-rate your subscription.

Rob