Skip to content

Commit

Permalink
Instagram progress (#43)
Browse files Browse the repository at this point in the history
* Instagram
* WhatsApp
* Facebook Messenger
* Message delivery status indication
* Reactions
* Bot support
  • Loading branch information
remdex authored Sep 5, 2024
1 parent 3dd411d commit 5c9111b
Show file tree
Hide file tree
Showing 93 changed files with 1,764 additions and 3,082 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
settings/settings.ini.php
composer.phar
composer-setup.php
composer-setup.php
modules/lhcron/check_integrations.php
97 changes: 93 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,96 @@
# Features

* Instagram
* WhatsApp
* Facebook Messenger
* Message delivery status indication
* Reactions
* Bot support

# Requirements

Min 4.26 Live Helper Chat version.
Min 4.46 Live Helper Chat version. 1.8v

Changes

* All messenger workflow will be handled by lhc core, so less bugs.
* Instagram support added
* Required scopes are defined in the settings file.

To manage instagram and whatsapp they both has to be matched to you page

# Permissions we request from facebook during login

Default scopes. You can change those in settings/settings.ini.php file

```
'email','pages_show_list','pages_messaging','instagram_manage_messages',
'instagram_basic','pages_manage_metadata','pages_read_engagement',
'whatsapp_business_management','whatsapp_business_messaging','business_management'
```

# Webhook configuration and subscription fields

Webhooks configuration place

![See image](https://raw.githubusercontent.com/LiveHelperChat/fbmessenger/master/doc/webhooks-app.png)

Products you should have

![See image](https://raw.githubusercontent.com/LiveHelperChat/fbmessenger/master/doc/products-app.png)


### Facebook messenger

In webhooks page you have to choose `Page` and subscribe to those fields

Subscribed fields - `message_deliveries,message_echoes,message_edits,message_reactions,message_reads,messages,messaging_postbacks`

### Instagram

In webhooks page you have to choose `Instagram` and subscribe to those fields

Subscribed fields - `messages,messages,messaging_postbacks,messaging_seen`

### WhatsApp

In webhooks page you have to choose `Whatsapp Business Account` and subscribe to those fields

Subscribed fields - `messages`

## Most common URL

### URL if you are using Facebook Login flow without automated hosting environment

This is the most common installation method and you choose what page you managed during login flow.

Webhook URL's. Use same URL for webhook verification calls.

* Facebook Messenger - `https://example.com/fbmessenger/fbmessenger/callbackgeneral`
* WhatsApp - `https://example.com/fbmessenger/callbackwhatsapp`
* Instagram - `https://example.com/fbmessenger/callbackinstagram`

Valid OAuth Redirect URIs

* `https://example.com/site_admin/fbmessenger/fbcallback`

### Webhook URL for facebook messenger if you define independent page

You create a facebook app and add pages manually to lhc back office without login flow.

* Facebook Messenger - `https://example.com/fbmessenger/fbmessenger/callback/<page_id>`

### URL if you are using Facebook Login flow with automated hosting environment

Valid OAuth Redirect URIs. `master.example.com` in this scenario is our manager address

* `https://master.example.com/site_admin/fbmessenger/fbcallbackstandalone`

Webhook URL's. Use same URL for webhook verification calls.

* Facebook Messenger - `https://master.example.com/fbmessenger/callbackstandalone`
* WhatsApp - `https://master.example.com/fbmessenger/callbackstandalonewhatsapp`
* Instagram - `https://master.example.com/fbmessenger/callbackstandaloneinstagram`

# Facebook messenger extension
Integration with Facebook messenger API. You will be able to chat with Facebook page users directly in lhc back office.
Expand Down Expand Up @@ -236,6 +326,5 @@ And add this line
```

# Todo
* Add support for images, not just plain messages.
* Add support for automated hosting environment.
* Get facebook user details like email or phone.
* Add support for typing indicator
* Add support for messenger notifications campaigns
Loading

0 comments on commit 5c9111b

Please sign in to comment.