App review is required to get Facebook Webhook working. How to develop? - facebook

I'm developing an app which must interact with Facebook API Graph and also use webhooks to get live updates. Now I'm facing a problem I can't receive a live webhook updates until my app is reviewed and is not in development mode.
I've found a thread on a Fecebook for developers site describing the same problem and it got official answer - it is not possible. Use Test button in app dashboard to test your webhook implementation they said.
The problem is the Test button sends only one predefined data packet for each of possible subscription with predefined set of fields with fake values, but documentation defines much more fields and little to none information about which fields are sent in different situations (i.e. post added, comment deleted, comment edited).
I'm wondering how other devs solving this? May be there are some community driven reference for a different webhook interaction cases or else.

For now I can't find any information on detailed webhook format except official documentation on available fields (but not supported payload shapes).
Our current workflow looks this way:
create test app
implement webhook handler using only documentation
prepare test payload and check it is working
create a screencast of the app functionality using test payloads
go through the review process
when app is approved
make it live and check your implementation against real webhook payloads

You need to create a test app for your existing Facebook app
Once you do this, just accept the permissions for your app and set the webhooks on your own Facebook account.
Since you are an admin of the test app, you will be able to set webhooks on yourself without having to get your app approved.

Related

Messenger - Chatbot without creating FB App for each Page

I built a chatbot that I plan to use with my pages. It's nothing special, only for development purposes. I used fastapi + mongodb + RASA NLU. It's all working fine with the integration by creating the app and subscribe to the webhook. the only problem I have is that I need to create one app per page. How can I link my chatbot to my page without creating an app all the time? I noticed ManyChat and ChatFuel can do this but I'm lost the fb developer documentation.
for reference, here's my current webhook setup.
https://myapp.com/webhook/<pageid_01>/
https://myapp.com/webhook/<pageid_02>/
https://myapp.com/webhook/<pageid_03>/
it's a workaround, of course. it works but I don't really want to maintain too many fb apps. not that I have many but between me and my friends who want to use my chatbot, it's not a pretty sight.
You can use the same webhook to handle events from multiple pages, but i don't think there is a way to make one fb messenger app for multiple pages! because the app will be receiving page-scoped unique Ids
You can just connect multiple pages to same app. And when you receive the event on your webhook, you can check the page-id and based on page-id, perform that page specific actions.

Trying to use Group info from Facebook API

I want to access the Group section of the Facebook API. However, it’s blocked behind requiring App Review. According to FB, I should have a thoroughly tested app before putting it under review?
How am I supposed to have a tested app and be ready for release if I don’t even have the API endpoints? Am I understanding this correctly?
As of right now, if I query anything Group related I get an OAuthException code 1.
https://developers.facebook.com/docs/apps/review/
but we recommend that you begin a submission only after you have thoroughly tested your app in development mode and you are ready for release.
https://developers.facebook.com/docs/graph-api/reference/user/groups/
As of April 4, 2018, this edge returns empty data sets for GET operations unless the calling app has gone through App Review. This applies to GET operations using /me/groups as well. Please see the Groups API section of the Breaking Changes changelog for more information.

How can i test Facebook webhooks in a development environment?

In my app we have webhooks setup so Facebook notifies us of changes in an ad account.
It looks like you can only set 1 URL for webhooks so i cant remove the production endpoint because that would mess up the production environment.
Is there any way i can send webhooks to another URL?
The only option i can think of is just hardcoding some fake payloads and testing my code that way.
Does anyone know if there is a way to set some type of development endpoint?
EDIT:
For anyone that comes back to this, a test app can never be "live" this means that calls that require an app that is not in development will not work. Maybe the best workaround is to create a duplicate app and get it approved.
Facebook has introduced a feature called Test Apps a while ago.
https://developers.facebook.com/docs/apps/test-apps
You can create a test version of your production app, that will get its own app id, and have its own app dashboard where you can change most of the settings - including webhook endpoints.

Is Instagram Content Publishing API available in a test environment without being a partner?

I'm looking at setting up an Instagram app so I can push content from my app directly to Instagram. I'm already doing this for Facebook, LinkedIn, and Twitter.
I know that Instagram is in the middle of moving to the Facebook Graph API, and it seems like there are several barriers to even start developing an app.
At the top of the Getting Started link there's a blurb stating that I need to undergo "Business Verification" to use the Instagram Graph API. Do I need to do this in order to use these endpoints in sandbox mode? (Edit: I believe this must be done in order to test the non-beta aspects of the API) In addition, the Content Publishing API seems to be locked down even further, requiring parternship with either Facebook or Instagram, and neither are accepting new applications.
Is there some way to test this in sandox mode without becoming a partner?
(Edit: Testing your app Suggests that I must do business validation in order to use the non-beta aspects, and there's no permission for publish_content, leading me to believe that I must be a business partner to even test this feature. Can anyone confirm?)
Januray 26, 2021
The Content Publishing beta has ended and all developers can now publish media on Instagram Professional accounts. Refer to the Content Publishing guide for usage details.
https://developers.facebook.com/docs/instagram-api/guides/content-publishing

Creating a Test Facebook app with publish action permission?

I see that Facebook has made a lot of changes in their API and working structure of those for creating the FB application for Web/IOS/Mobile.
I am creating a facebook app with my FB developer account to get the Test App's API secret credentials.
With this app I need to test the feature of Publish_ations (Ex:- Post on pages/wall,sharing),but that feature is not enabled for Test App API.And if we want to enable that then we may have to submit the review with some details.In those details they are asking for the steps to test the feature that we will provide in our Application.They need the snaps of pages where that FB feature will be and ETC of info.And that whole process will take upto 7 days.
I am confused that if my application is in progress and that FB feature we are planning to develope then How should I give the steps to test the Feature on our website before creation of that Feature.
Is there any information that I am missing from FB docs for testing enviornment with Publish Action permission.
Please help me I have already wasted 7 days (Tried the review submission process of FB and they have rejected that because of incomplete application and information)
Thanks in advance!!
You're confused. The login/permissions related things works as it was in v1.0 ; just the difference is that you need to submit for review after the app is ready. But that's the last step.
I think you're using the API for the first time, so you may not be aware how exactly to add the permissions in your app. The permissions are added using the scope parameter in the login code. See the details here..
For example, if you're using the JS SDK-
FB.login(function(response) {
// handle the response
}, {scope: 'email,user_likes'});
similarly its done for the other languages.
After adding the permission the admin/developers/testers of the app can test the application and publish posts; while app is in development mode. And this is just similar how we used to do in v1.0.
When your app is ready (the last step), submit your app for the login review (this step wasn't present in the v1.0, you just needed to make it live). After they approve your app with this permission, you can make your app live and everybody can publish post using your app. That's it.