Aman Bhatia
Aman Bhatia

Reputation: 21

How to implement unsend messages in Instagram Graph API

I have integrated Instagram graph API with Salesforce and it's working fine. Now I want to implement unsend messages but Instagram webhook is not sending any notification

I tried after subscribing "messages" webhook event but it is not sending any notification

Upvotes: 2

Views: 600

Answers (2)

Nijat Aliyev
Nijat Aliyev

Reputation: 894

Solution for Unsend Messages on Instagram via Android Studio

Issue: Currently, the Unsend messages webhook on Instagram does not work when using a desktop browser. While the delete message webhook is triggered on mobile, it’s not functional in the browser version.

Proposed Solution: Use Android Studio with the built-in Android emulator to access Instagram and ensure the Unsend webhook works effectively.

NOTE: This solution is good for if you need send screen recording to META. Otherwise it is working properly on mobile devices

Example screenshot: enter image description here

Steps to Get Started:

  1. Install Android Studio:

  2. Set Up an Emulator:

    • Open Android Studio and create a new project (you can choose any template).
    • Navigate to Tools > AVD Manager (Android Virtual Device Manager).
    • Click on Create Virtual Device and select a device model (e.g., Pixel 4).
    • Choose a system image (preferably the latest version) and click Next.
    • Configure the AVD settings as needed and click Finish.
  3. Launch the Emulator:

    • In the AVD Manager, click the green play button next to your newly created virtual device to start the emulator.
  4. Log in to Your Google Account:

    • Once the emulator is running, open the Google Play Store app.
    • Log in with your Google account to access the Play Store.
  5. Download Instagram:

    • Search for Instagram in the Play Store, install it, and open the app.
  6. Log in to Your Instagram Account:

    • Use your credentials to log into your Instagram account.
  7. Test the Unsend Functionality:

    • Send messages through Instagram and test the Unsend feature to ensure the webhook triggers correctly.

Upvotes: 0

Will Bowman
Will Bowman

Reputation: 417

The webhook, on my test app, does not send any delete notifications (as well as reactions, seen, etc).

Looking over the docs you will see a webhook example that includes the is_deleted option.

I would copy a regular message payload and using curl or postman send your own request that includes is_deleted to help test.

https://developers.facebook.com/docs/messenger-platform/instagram/features/webhook#webhook-events

  1. Copy your message payload.
  2. Inject "is_deleted": true into the message object in the messaging array.
{
  "object": "instagram",
  "entry": [
    {
      ...
      "messaging": [
        {
          ...
          "is_deleted": true  
          ...
      ]
    }
  ]
}

Upvotes: 0

Related Questions