Send Message to users inbox using PHP based facebook apps - php

I have created an application which can post to users wall or even send emails to selected users, what I have not been able to come up with is the functionality to let an application send a message to users facebook inbox, I have googled it and found that applications are not allowed to send messages to users inbox however there's this product called rockmelt browser which does the same thing.
There's has to be some way which allows sending messages to users inbox.
Can somebody guide me on this?

It appears that you cannot send a message to a user's inbox. The closest thing may be this http://developers.facebook.com/docs/reference/rest/livemessage.send/. It allows you to send a live message to a particular user's browser.
Hope this helps.

If you are sending the message from your application user to one of their Facebook friends, you can use a Request, which will show up in the notification area. When the user clicks on the notification, they'll be taken to your App Canvas where you can show them the full message and any other app interactions you want.

Related

Google Hangout Chat - Send Direct Message to user

I am using various parts of GSuite - authenticating, accessing calendar and drive. I would like to offer users to be able to send direct messages to other users.
I cannot find any example of this online. I have found references to bots sending messages to rooms, but I want to send a message from the authenticated user, to another user in the gSuite.
Could anybody please point me in the right direction.

Facebook Messenger Bot - disable bot automatically when owner start answering questions

I have created a Facebook messenger bot that is working perfectly. I used php to create it.
Now, I want to add some new functionality. When the bot owner is online in Messenger and starts answering messages, the bot should stop responding to users.
How can i detect when the owner has started answering?
I did a test on this before.
You can try subscribing to "message_echo" webhook. This webhook is called when the page AND the bot sends a message to a user. So you'll need to differentiate which "message_echo" is from the page (a person) and which is from the bot. In the json that webhook sent, messages from the bot will contain an app_id key in the message object.
Your server will get a lot of hits by subscribing to this webhook.
A simple idea is to send the Bot a message from an administrator account. For example, if the admin sends 'STOP' then the Bot stops sending messages until an admin sends 'START'.
The incoming events to the Bot contains the sender id. The sender id would have to be correlated to a particular administrator id. The only way I have found to get that id for a particular user is to send a message and print out the id. The id is specific for the Bot and user combination. For example, my Bot will send a message to my personal account with this JS line:
sendTextMessage(1073962542672604,fistName + " " + lastName + " " + messageText); // send a message to Matthew directly
Sounds like you have a bot working but if you need more details, have a look at my Bot and source code.
Just for fun, I added this functionality to my Bot. To see details in the node.js implementation, search for the 'isStopped' variable in the app.js script.

How to add default message in facebook send dialog message box on friends invite

I need to send message to my facebooks friends which should include:
- default text message
- url
- my custom message
and I need to know to whom this message was sent.
Please advise how this can be done
Have a look at https://developers.facebook.com/docs/sharing/reference/send-dialog
This states that
Facebook messages are a channel for person-to-person communication, and not for apps to send messages, or encourage people to spam their friends. In general, games on Facebook.com should use requests when communicating in game status (its your turn), inviting people to use an application, or sending messages to multiple people. You should offer the Send Dialog in situations when someone might otherwise send an email.
So I doubt that what you want to do adheres to Facebook's policies, and therefore will likely trigger a deactivation of your app.

Receive chat from non-friend from Facebook Chat API

I've logged in and used the Facebook CHAT api all right. The problem is that I want to have a system where anyone can send me a message, without actually being on the friend list.
When the sender is in the friend list, I see the message. Is there a possibility that I can configure my account to receive messages from anyone, independing on if they are in the friend list or not?
Best Regards.
The Chat API and the Message API are not the same.
You may want to think of Chat as a subset of messages.
When a message is received and the user is a friend you receive a chat notification, if not, no response.

Facebook API send automated private messages to yourself

I'm using Facebook Connect on my website. I need to enable users to send themselves automated private messages from my site to their Facebook account. Does the Facebook API allow this?
Edit: I found a solution https://developers.facebook.com/docs/reference/dialogs/send/ however I need to send messages without the user interacting with the write message pop up. Messages should be sent directly if possible because they are automated, set up by the user once.
You can send to their facebook email. Facebook email is consisting profile nickname+'#facebook.com'. The email will goes to their facebook inbox message. Note that facebook email does not accept spoofing email. You will need whitelabel domain or use SendGrid.

Categories