facebook.showDialog() doesn't return a response on Android (but does in iOS)

The requirement to delete an apprequest is a bit confusing, but yes, you have to do it yourself.  (If you don’t, they automatically expire after two weeks.)  I think Facebook’s reasoning is that app’s will vary in how they use apprequests, so it’s better to leave it to the app to delete it at the right time than for Facebook to make an assumption about when that should be.

Let’s say a user receives an apprequest.  You can query their apprequests via a GET to “me/apprequests”.  This’ll return a JSON that includes an array of all apprequests that user received, which includes a Facebook assigned id.  Once you’ve done whatever it is you want to do with it, you delete it by issuing a delete to “/<id>” where <id> is the id of the apprequest.

  • Andrew

When I see the confirmation dialog before sending an apprequest, the complete message text is visible. But when I get the notification on one of my test user accounts, the only message is “username has sent you a request” and my app name. The message I crafted so carefully is nowhere in sight. I’ve looked for any app or account settings that might affect how requests are viewed and I don’t find any, so is this just the way requests work on a mobile device? What is the purpose of attaching a message to an apprequest?

@sajent,

That’s a common misunderstanding of how the ‘message’ parameter in a Facebook request works.  Unfortunately, the recipient can only see the ‘message’ if they go to the Facebook App Center.  In their notification area, you can’t customize the message as far as I know.  It can only ever say “So and So invited you to play App” (if they don’t yet play the game) or “App: So and So sent you a request” (if they already play the game).

  • Andrew

Thanks for clearing that up, Andrew. Now I’m trying to delete my apprequests. Can anyone tell me why this doesn’t work?

local function facebookEvent(event)
  if event.isError then
    print(event.status)
  end
end
local headers = {}
headers[“Content-Type”] = “application/x-www-form-urlencoded”
headers[“Accept-Language”] = “en-US”
local params = {}
params.headers = headers
local tokenParm = “access_token=”…facebookToken  – token returned by facebook.login(), works OK to get me/apprequests
params.body = tokenParm
local urlReq = “https://graph.facebook.com/”…data[i].id  – element in the table returned from me/apprequests
network.request(urlReq, “DELETE”, facebookEvent, params)

event.status is not printing, so I assume event.isError is false. But all the apprequests are still there the next time I list them. The id I’m passing is definitely the concatenated request_user. I can’t figure out where I’ve gone wrong. I’m working from this example in Facebook:

DELETE https://graph.facebook.com/[<REQUEST_OBJECT_ID>_<USER_ID>]?access_token=[USER or APP ACCESS TOKEN]

You should probably be using facebook.request(), not network.request(), when making requests to facebook.  Aside from taking care of the access token for you, there may be other reasons why you have to use facebook.request() (although I’m intrigued by the idea of using network.request(), since it would let you set up callbacks for each request, among other things).

For me, I delete an apprequest with facebook.request("/apprequestID", “DELETE”).  Despite the fact that Facebook’s documentation suggests concatenating the apprequestID with the userID, I’ve found that doesn’t work, and you just need to use the apprequestID.

  • Andrew

I hope its okay to post this here, even if its not 100% align with topic.

I have implemented the share dialog, and it works fine. But on Android (could not test on iphone) the dialog has 3 options:

  1. “X” in the upper left

  2. “Cancel” on the left side of the title

  3. “Send” on the right side of the title

When I use send, it works quite good and I get a result. If I click the “X” to close the share dialog I get a response with “isError” true AND “didComplete” false, wich is a little confusing but not the main problem. The main problem is, that hitting “Cancel” returns the exact same as if I use “Send”. I did not find a way to check if the post was actually submitted.

I/Corona  (30585): phase:nil type: dialog
I/Corona  (30585): ### type: dialog
I/Corona  (30585): ### name: fbconnect
I/Corona  (30585): ### didComplete: true
I/Corona  (30585): ### isError: false
I/Corona  (30585): ### response: fbconnect://success

I am giving the user a feedback that a post was sucessfully sent. Now the user gets the feedback, that the post has been submitted even if he cancelled the dialog. And this can be very confusing for the user!

Is this a bug? Or am I doing something wrong?

croftware - I just started testing this out myself and you can tell the difference between a “Cancel” and “Send” event.  The “Send” event includes the post id in the response field.

 [response] => "fbconnect://success?post_id=1423…

A “Cancel” event does not, i.e. 

 [response] => “fbconnect://success”

I haven’t tried this on iOS yet but it seems to hold for Android so far.

Hope that helps!

I’m using latest build 2520 and I get the fbconnect://success?.. as a response too when I use apprequests on showdialog. I am not receiving any requests on any of my users. Can we get this to work ?? 

I hope its okay to post this here, even if its not 100% align with topic.

I have implemented the share dialog, and it works fine. But on Android (could not test on iphone) the dialog has 3 options:

  1. “X” in the upper left

  2. “Cancel” on the left side of the title

  3. “Send” on the right side of the title

When I use send, it works quite good and I get a result. If I click the “X” to close the share dialog I get a response with “isError” true AND “didComplete” false, wich is a little confusing but not the main problem. The main problem is, that hitting “Cancel” returns the exact same as if I use “Send”. I did not find a way to check if the post was actually submitted.

I/Corona  (30585): phase:nil type: dialog
I/Corona  (30585): ### type: dialog
I/Corona  (30585): ### name: fbconnect
I/Corona  (30585): ### didComplete: true
I/Corona  (30585): ### isError: false
I/Corona  (30585): ### response: fbconnect://success

I am giving the user a feedback that a post was sucessfully sent. Now the user gets the feedback, that the post has been submitted even if he cancelled the dialog. And this can be very confusing for the user!

Is this a bug? Or am I doing something wrong?

croftware - I just started testing this out myself and you can tell the difference between a “Cancel” and “Send” event.  The “Send” event includes the post id in the response field.

 [response] => "fbconnect://success?post_id=1423…

A “Cancel” event does not, i.e. 

 [response] => “fbconnect://success”

I haven’t tried this on iOS yet but it seems to hold for Android so far.

Hope that helps!

I’m using latest build 2520 and I get the fbconnect://success?.. as a response too when I use apprequests on showdialog. I am not receiving any requests on any of my users. Can we get this to work ??