facebookpublish_action - comprobar si salta presionado

quiero usar el facebook publish_action permission to post on user's timeline.

This presents a page which asks for permission and there are 2 buttons Okay y Skip.

However when I test both buttons, there seems to be no difference in the callback url. There is no error code or anything like that, using which I can check whether Okay or Skip fue presionado.

How can I do so? It seems I am missing something here.

Right now I am making the call to post on the timeline and expectedly getting the following result:

403
{"error":
    {"message":"(#200) The user hasn't authorized the application to perform
                this action",
     "type":"OAuthException",
     "code":200
    }
}

preguntado el 17 de mayo de 13 a las 07:05

1 Respuestas

You are not missing anything. When the user is presented with the option to allow or deny an Permiso extendido, irrespective of what they choose, they would be redirected to your redirect URL.

The error is sent only when the User denies authorizing the application. There are two ways to deal with these errors

  • Catch these errors thrown and check if they are in range of 200-299, which correspond to User either has not granted a permission or removed a permission (Quoting from Errors documentación). And then according to the thing you were trying, ask for the permission once more.

  • Check if you have enough permission to perform a API call prior to making it, by checking at /user-id/permissions punto final

contestado el 17 de mayo de 13 a las 11:05

Just when you get a response - you need to check the permissions to see if publish_actions permission is a part of the list - if it is - good to go... - foxybagga

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.