How can i test Facebook webhooks in a development environment? - facebook

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.

Related

Is it allowed to use Data retrieved from an Instagram Basic Display API App in Development Mode for production purposes?

My use case is fairly simple: I want do display the latest images of an Instagram profile I own on a public website I own.
For this purpose I've written an integration of the Instagram Basic Display API, registered an app with https://developers.facebook.com/apps/, implemented an automated access token renewal mechanism and everything works locally.
So, as I'm about to publish this feature to the website, I'm not able to find any official policy from Facebook that clearifies whether or not I'm required to put this app in "Live Mode".
Technically, "Live Mode" has no benefits to my use case and I'd find it way out of proportion to go through an App Review process, just to display a list of images that are my own anyway. So my question is:
Given this scenario, is it allowed to keep said App in "Development Mode", while still using its data for production purposes?
And: Are there any official statements on this, that any of you might be aware of and that I'm just not able to find?
I found this: https://developers.facebook.com/blog/post/2019/09/23/live-mode-for-production-use/
But even though the headline is fairly unambiguous, the article itself doesn't help making the issue any clearer...
It is OK to use Development mode in such case: https://developers.facebook.com/docs/app-review/introduction
If your app will only be used by app users who have a role on the app or claimant Business, App Review is not required and your app does not need to be switched to Live mode.

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

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.

How to have facebook messenger bot in local, staging and production

Context
I'm working on a facebook messenger bot and have a workflow issue.
To create it i used ngrok to make a facebook test application hook on my local and it worked fine.
Now the bot is in staging for test and an other application have the webhook pointing to the stage server.
For the production server i intend to do a production application that will have webhook pointing on it.
Question
But since an application has to be attached to a page to start a conversation to it, how can i test several bots ?
Do i need 3 pages (local test, staging test and production) ?
Or is there a Facebook way to it ? (test version of app is not working for now on messenger bot, known bug)
Or maybe a good practice ?
You are looking for Test Apps in Facebook App Development. You can find this setting on the Developer Page on the top left where you can find a drop-down button to create a Test App.
I use to create my dev and staging environment.
Docs on this seem non-existent. It does seem like you need separate pages and bots for test/staging environments.
Here's what I did for the bot I made.
Make test/staging pages.
Unpublish those pages so they're not publicly searchable.
Give testers/devs Page Roles on the page so they can search for and find it.
Give those same testers/devs roles in the bot dashboard so they can actually chat with the bot.

Azure Logic App - Authorization Issue

In Azure Logic App, I added a Twitter connector, even after Authorizing the same, the Authorize button doesn't go away and I am not able to proceed.
Sajad,
Currently the default application associated with Logic Apps for Twitter is broken -- we are looking to fix it. In the meantime, if you associate the Twitter API App with your own Twitter App information (you can set one up for free), the logic app will run and authorize successfully. Here's some details on how you can do that. Let me know if you have any questions or issues, and apologies for the inconvenience
http://aka.ms/oauth_connectors

how to bugtest facebook apps in private?

I'm just trying to develope a facebook app, so sorry if this question is quite simple. I've set up my App, then entered the canvas URL and thought I could test the app and fiddle around with it in private without anyone knowing. But there was immediately a "is using 'hisnewpp'" message going around or something. Of course I didn't want that since the app is not finished. I couldn't find a setting anywhere, where I could set the app to be public or private.
So in short: where can I call up and test my App on Facebook, without it beeing accessable to anyone else?
Thanks a lot
you want to enable sandbox mode in your application's advanced settings. Only you will see the updates then.
Use test users - https://developers.facebook.com/docs/test_users/
You can create temporary or long term test accounts specifically for testing your app - either via the API or in the app settings. You can also place the app in sandbox mode and only developers or testers of the app can interact with the app and/or see the content it produces