What is needed to get simple Facebook webhook to work? - facebook

I have created a simple FB webhook app and have subscribed to trigger on feed activity. I successfully added and tested the user subscription, and clicking the webhook test button test works perfectly.
I have fulfilled all requirements and it is now live, but it does not work on my live FB feed.
I saw a post saying that I needed to obtain "pages_manage_metadata" and "pages_show_list" permissions, and I have been approved for that, but it still won't work despite being in live mode.
What am I missing?

Related

Why is the Instagram Graph API webhook not working

I am not able to get webhook calls when another user post a comment (with mentions) on another/my media.
Just for testing purposes I set up a ngrok server for my webhook endpoint, which always answers with a 200 and handles the verfication. Before the heavy coding I just wanted to see if the webhook workflow for Instagram is generally working.
I created a Facebook app, an Instagram business account, a Facebook page and linked the page with the Instagram business account. With the information at Webhooks for Instagram I created a page access token with the Graph API Explorer. When I debug the token with the Access Token Debugger, everything looks fine. All needed permissions like manage_pages, pages_show_list, instagram_basic, instagram_manage_comments, instagram_manage_insights, public_profile are there. With the page access token I am able to fetch all informations regarding my linked Instagram business account via the Graph API Explorer.
Also the Instagram product was automatically added to my Facebook app. Test requests, which where send via the app dashboard (Webhooks product), will be received by my ngrok server. But any type of mentions or comments from another or my Instagram account (business or not) on my or other medias will not be received. What am I doing wrong? Do I have to send those comments/mentions from a specific account, since the app is in development mode and there roles in the app?
After speaking with the Facebook support, my confusion has been resolved.
The problem is that the Webhook for the Instagram product does not work without a verified app review. I had been wondering how to record a screencast with my running solution, without running webhooks... Above all, I had wondered why the webhooks in dev mode worked for the product messenger but not for instagram (or others). Apparently, the app review is not about the technical implementation but rather about checking that the implementation complies with the facebook guidelines. Therefor I want to quote the Facebook support:
Messenger does allow page owners and app admins to receive webhooks for their implementations in devmode and is by design. However, this is not the same for instagram or pages. This is just how the product teams have decided to implement it. For app review, you can show a mock process of the flow, using either the test webhook or your own process. The app review is less about technical implementation steps, but just a way to make sure that your app is going to use the permission in a way that follows our guidelines, so mocking the procedure should be fine. The reviewers understand that you do not receive webhooks in dev mode and should take this into consideration.
Consequently, I will now have to submit an app review and for that I have to imitate the webhook.

Facebook Page Feed Webhook work in test but not when live

I have created a webhook to receive feed updates. I want to be notified when a post is liked or commented on or shared. I have set the endpoints up in a script on my server, i have also set up the webhook in the developers console. When i send a test event from the dev console in the webhook section my endpoint receives and processes it fine. When i set my app to live, nothing seems to be sent to the webhook from my page when i like or comment or post. I have followed all the instructions exactly. I have subscribed my page to the app and checked that it is subscribed, and also i have set my app to live. Yet there are still no webhook events received... Any one got any idea what im missing??
you have to get this permission pages_manage_metadata to get the feed activity on your webhook

Questions about FB chatbot app review

I have an FB app ready for app review. That app provides basically a chatbot.
I have 2 questions:
1 - Can I set a webhook of a staging bot instance that is connected to a staging core system to which an FB user can authenticate using specific credentials. I ask this because I don't want to provide Production credentials to the FB reviewer.
2 - Can I provide the reviewer with a test FB page, or do I need to provide the final FB page?
In case of affirmative answers to both questions, when I set Production webhook URL and FB page, do I need to resubmit app review?
Thanks
when I set Production webhook URL and FB page, do I need to resubmit app review?
You can change your webhook URL at any time, that doesn’t require review. And what page(s) you subscribe your bot to doesn’t either.
Review is about the functionality your app provides, and how it uses the data it gets access to. Simply switching out the URL you receive the webhook request under, or which page(s) your bot is running on, is not relevant in that regard. That you switch from a test page to a live page after you got it successfully reviewed might rather be the norm than an exception. Plus, your bot can be used on multiple pages, so that you add others later on is also an expected use case.

Facebook Webhook for subscribing to a page (conversations) doesn't send a notification

I've been trying to setup a subscription to a page I own on Facebook using an App I've been using for many years (and this used to work for subscriptions to another Page).
Webhooks are setup, and a subscription has been created for 'conversations' to post back to a url on our server. When I test this through the webhooks page I can see the request come through on the server.
The only step that seemed to be missing was subscribing the page to the app itself.
However, I have now done this by issuing a POST request through the Graph Explorer directly to [page_id]/subscribed_apps. This returns true. When doing this however it requires a Page Access Token and gives me the Facebook authorization popup with a message saying:
"Submit for Login Review - Some of the permissions below have not been approved for use by Facebook."
I've worked out it means the 'manage_pages' permission.
If I click "OK" it goes through (presumably because the user I am authorizing as is a page admin?).
When I do a GET request to the same endpoint ([page_id]/subscribed_apps) I can see my App listed.
However, when a conversation on the page is updated (comment or new post) I don't receive a notification on the server.
Could this be because the permission isn't approved by Facebook, despite the fact that it shows as a subscribed App? I definitely didn't have to go through this before as the same App is live listening on notifications from another page without that permission granted, but I'm questioning whether something has since changed in the API.
Unfortunately this project goes live tomorrow so I don't have time to go through the Facebook review process...
Thanks for your help!
EDIT: I just attempted to subscribe to the description and/or mission fields on the page and edited these as the page owner and the notification came through instantly via the same webhooks subscription... which makes this even more confusing as it only seems to be failing for "conversations" eg: new posts/comments.

facebook callback_url is not called for real time updates via app subscriptions?

I am fairly new to fb app development and I am trying to get real time updates from my page via app using subscriptions. So I created a subscription first which works fine and I got success, it calls my localserver for the verification.
and when I see subscriptions on app it shows the following output which I guess is correct.
Now this app is added on my fb page so once I go to tab my POST request is called,
Since I have subscribed to feed,name which means any new post or change in page name will trigger a POST request to my callback_url whcih is not happening, please let me know what I am doing wrong.
UPDATE:
just an update my callback url is now hit by facebook but I am not getting any useful object in JSON
JSON:{"bufferSize":8192,"contentWritten":0,"status":200,"committed":false,"outputStream":{},"locale":"en_US","finished":false,"headerNames":[],"characterEncoding":"ISO-8859-1"}