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.
Related
I am looking to create an application in which I connect with oauth2 to my discord account, in order to send in all the channels where I am, a message, with my own account (not as a BOT)
Only I don't see any options in the scope https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes to do it. Even if I put them all in, I will be able to read messages at best, but not write them.
How could I do this? Thank you !
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.
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.
I'm building an app and the client wants the following logic:
User logs in to the app.
User selects a Friend.
User selects a gift that the User will send to his Friend.
User writes a message to his Friend.
Friend receives a SECRET notification about the gift.
With "SECRET" I mean that Friend will not be able to see WHO is the User that sent the gift.
So the concrete question is how to send a notification to the FRIEND without a clue about the USER that sent it? I think is not possible but I want to be sure and check with the experts.
And if it's not possible, what do you recommend to accomplish something like this? Should I use the app request dialog and hope that the Friend will see it? Is there any other FB API tool I can use?
I really appreciate your help.
What you're trying to achieve is not possible with FB's API. As explained already by #CBroe.
You can send a request notification if the user uses your app. However, You can do one thing but that won't be completely anonymous.
You can send the friend a notification from the user and make it just an invite to try the application and after the friend uses your app (authenticates), your app can then send a notification and say someone left a SECRET message for them. This could be after few hours or instant, Whatever you/your client prefers. However as i said, this won't be completely anonymous nor it's hard to guess who left the message unless the friend isn't smart enough to know who that could be.
With the beta Notification API something similar would be possible, but only if the receiver has authenticated your app: https://developers.facebook.com/docs/games/notifications/#impl
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.