Sending proactive bot framework messages to Facebook Messenger - facebook

If you use Resumption cookies to store conversation information between a user and your bot then you can initiate a proactive message. This works great for Facebook Messenger only as long as the user does not delete the conversation.
If they do then you get a 401 error and the user needs to once again initiate a conversation.
Is there any way to send a proactive message to a Facebook user even after they have deleted the conversation? This works fine in Skype for example.

Unfortunately it is not possible. In FBM when you delete a conversation with a bot, it can be interpreted as there is not any conversation in side of the FBM with the previous conversationId. Therefore, the bot can not instantiate a conversation up to user initiate a conversation with bot.

Related

Facebook Messenger Inbox in a Web Dashboard

I am creating a web dashboard and want to integrate my facebook page messenger inbox on the dashboard, so we do not have to login into facebook or messenger to view and reply to the messages we have received on FB. For example the inboxes that frontapp, smooch provide.
I am not sure if I need to save the messages we get in webhooks and the replies also or we can access it through API.
I am also confused that if I create an app and connect that to the dashboard , that the user can reply from the dashboard and the message will be delivered to the user through the app, is it possible to send the message after the 24 hour window (plus 1 message) fb allows for apps if they reply from FB app, or it considered as bot as the messages are delivered through app.
You can get the page conversations:
https://developers.facebook.com/docs/graph-api/reference/v2.12/page/conversations
And then respond to them by conversation ID:
https://developers.facebook.com/docs/graph-api/reference/v2.12/conversation/messages

Sending notifications via Messenger Bot to Facebook OAuth registered users

Let's say you have a site that accepts Facebook OAuth registrations/login. Today, the typical pattern is to capture the user's email and send them notifications via that channel. Fine.
Messenger bots have now opened up an opportunity to engage with users directly via Messenger rather than relying on email. In markets where Messenger is heavily used and email hardly ever, notifications via Messenger are a big deal.
Reading the documentation my understanding is that Facebook user id's are application scoped. I wouldn't be able to send a user registered via Facebook's OAuth a message on Messenger.
Has anyone done this? Is it possible or at least being considered in a future spec?
Use checkbox plugin for messenger in web app flow, this is meant for the same purpose!

Facebook Messenger API pages_messaging permission

I am creating an application where I need a user to be able to grant us access to their facebook page so that all incoming messages can flow through our application (as well as outgoing).
I have this all working correctly, but facebook will not approve my app due to the facebook permission pages_messaging and them "not receiving a response from my bot" (I have been denied three straight times). What am I doing wrong here? We are not using bots, do I even need the pages_messaging permission (I am using their webhook to get incoming page messages, and graph api to send outgoing)?
When submitting app, pages_messaging permission says:
Please provide the page that can be used to test this bot. Make sure the bot is properly connected and functional, otherwise your submission may be rejected.
Here is facebook's feedback from my submission (denied multiple times):
Thank you for your submission. We tested the messenger experience on your associated page and received no response from your messenger bot. Please resubmit with the new, improved version of your bot.
You got to create a bot to use the messaging API: https://developers.facebook.com/docs/messenger-platform/implementation
To just read/send messages:
https://developers.facebook.com/docs/graph-api/reference/v2.6/conversation/messages
You can use the /pageID/conversations endpoint to retrieve all conversations your page has had with FB profiles.
Next you can read/post to the /conversationID/messages endpoint to read/respond to a person.
And you can even subscribe to the conversations field for pages with webhooks.
You will need a page admin's page access token that has the read_page_mailboxes permission scope to set up the subscription, and to read/reply to messages.

It is possible to remove user message from Facebook Bot chat?

I need some feature to remove user input message from conversation with my facebook bot.
I need to make authorization routine with my server application, because it working with private user information.
Therefore I want to make prompt of user password and of course it must be removed from the chat or replaced with ******.
How to handle this kind of scenario via Facebook Bot Chat ?
If it impossible, can anyone suggest me a workaround to this problem ?
Many thanks
I tried to find a way to delete a message / conversation from Facebook bot chat via Facebook apis but was not able to find a way or a specific api to delete message / conversation.
However for this particular scenario Facebook has given a way to authenticate a user with our own system with. https://developers.facebook.com/docs/messenger-platform/account-linking
So you could use this to authenticate a user with your system with login process and unauthenticated with logout process.
Hope this helps for others who has similar thoughts.

Can we send private messages to friends of a user with offline_access permission?

Is it possible to send private messages to the friends of a user after getting the offline_access permission from him?
While sending app requests, I know its possible to send app_requests to any user(using app_access_token) who is already a part of the application. Like wise is it possible to send using offline_access permission without using send dialog or any other operation which needs the user consent?
No, this is not possible, the only Facebook communication channels you can use are stream Posts and App requests, and if the user is offline, you cannot publish posts as it is against Facebook Platform Policy IV.3.
If this is user-to-user communication, you may be able to send an email to the users username#facebook.com email address, which will create a message for them. However Policy IV.5 explains the limitations of this.