botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[.Net SDK, FB Messenger] How to send proactive message on Messenger?

Open harigovind511 opened this issue 8 years ago • 8 comments

Bot Info

  • SDK Platform: .NET
  • SDK Version: 3.12.2.4
  • Active Channels: facebook,sms
  • Deployment Environment: Auzure Bot Service

Issue Description

Unable to send proactive messages on face book channel. I read in document as it requires pages_messaging_subscriptions approved. But to test at the time of development, can we do proactive messaging without approval. if so could you please share me steps to follow to send proactive message on facebook.

Thanks in advance..

harigovind511 avatar Jan 07 '18 10:01 harigovind511

Have you seen this doc?

JasonSowers avatar Jan 08 '18 22:01 JasonSowers

Thanks for the response @JasonSowers . Yes I have followed the same and proactive messages are working fine with other channels. But my requirement is specific to face book which is not working with the same code. Am I need to do any sort of settings change in facebook developer page to do this?. And do we need to get approval from face book to send proactive messages to users at development stage?

harigovind511 avatar Jan 09 '18 10:01 harigovind511

@harigovind511 I think you can't use proactive messages on Facebook outside 24-Hour Messaging Window https://developers.facebook.com/docs/messenger-platform/policy/policy-overview#standard_messaging until this Feature request isn't implemented https://github.com/Microsoft/BotBuilder/issues/2924 @JasonSowers Could you please ask developers to implement it?

ma3yta avatar Jan 09 '18 17:01 ma3yta

I can ask, but no promises. 👍

JasonSowers avatar Jan 09 '18 17:01 JasonSowers

@harigovind511 @JasonSowers I found how I can add a tag.

var activity = (Activity)message;
activity.Properties = new Newtonsoft.Json.Linq.JObject();
activity.Properties.Add("tag", "APPLICATION_UPDATE");

I checked it in Facebook and all works fine.

ma3yta avatar Jan 09 '18 18:01 ma3yta

Hi @Ma3yTa, Thanks for sharing. Could you please elaborate, how can we use it to send Proactive messages on facebook. If possible could you please share C# code snippet for the same, which will be more helpful for us.

Kothakapu avatar Jan 10 '18 22:01 Kothakapu

@Kothakapu have you find a solution ? I'm creating a messenger bot , and i need to create a module to send broadcast message to users in a specific time .

stelazh avatar May 02 '18 15:05 stelazh

Messenger bot developer permissions are determined by Facebook.

Please post Bot Framework Facebook Messenger requests here: https://github.com/Microsoft/BotBuilder/issues/4360

Based on Facebook documentation, bots are allowed to send subscription messages to FB Messenger users: https://developers.facebook.com/docs/messenger-platform/send-messages/

Jason has provided a reference to the docs, and some basic proactive messaging samples can be found here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-proactiveMessages

EricDahlvang avatar Aug 14 '18 00:08 EricDahlvang