i am working with Facebook Checkbox Plugin everything is working fine and I am able to render the plugin. My problem is that facebook is not sending request to my webhook url when Confirming Opt-in. in the facebook docs it is mentioned that
"After the opt-in event, we will post a webhook event to your server if the checkbox state was checked. This callback has the same format as the opt-in callback, but instead of a sender field, it has an optin object with a user_ref field".
my code for subscribing to the webhook is .
if request.method=='GET': try: myfb_token='xxxx'#to go to settings if self.request.query_params['hub.mode']: if self.request.query_params['hub.verify_token']==myfb_token: res=int(self.request.query_params['hub.challenge']) status_code=200 else: status_code=422 res={"unable to verify"} except Exception as e: res={"invalid request"} status_code = 422 return Response(res, status=200) else: print(request.data) return Response("webhook posts", status=200)
This works fine and am able to subscribe. Am also able to test my webhook and hit my server from my app . However the webhook does post to my server when the plugin is checked. My app is still in development mode and am using my facebook account for testing as an admin. I have also subcribed to the messaging_optin webhook
Aucun commentaire:
Enregistrer un commentaire