From b2a254dffe3dc86d8aaca5c5d9a86489d638af1a Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Mon, 2 Oct 2017 11:30:56 +0200 Subject: [PATCH] Facebook Messenger component: add support for sending messages to user IDs (#3489) This is the documentation change for https://github.com/home-assistant/home-assistant/pull/9643 --- source/_components/notify.facebook.markdown | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/source/_components/notify.facebook.markdown b/source/_components/notify.facebook.markdown index 3dd7ee2fd4a..1d76436a13e 100644 --- a/source/_components/notify.facebook.markdown +++ b/source/_components/notify.facebook.markdown @@ -50,6 +50,51 @@ automation: - +919784516314 ``` +You can also send messages to users that do not have stored their phone number with Facebook, but this requires a bit more work. The Messenger platform uses page specific user IDs instead of a global user ID. You will need to enable a webhook for the "messages" event in Facebook's developer console. Once a user writes a message to a page, that webhook will then receive the user's page specifc ID as part of the webhook's payload. Below is a simple PHP script that reacts to the message "get my id" and sends a reply containing the user's ID: + +```php +