I need to get via Facebook connect user's info and send a private message to all of his friends. Is it possible?
相关问题
- facebook error invalid key hash for some devices
- LoginActivty with Firebase & Facebook authenticati
- facebook “could not retrieve data from URL”
- JDK 11. javax.net.ssl.SSLPeerUnverifiedException:
- setRequestHeader Content-Type causes POST request
相关文章
- Facebook login for group members
- The method FB.api will stop working when called fr
- React native deep linking vs Facebook SDK conflct
- UIActivity with no settings for Facebook
- facebook send API Error Code: 100 API Error Descri
- How to fix 'Facebook has detected MyApp isn
- Can't use Facebook Account Kit: Error inflatin
- Facebook API error subcode 33
You cannot. Facebook API has read_mailbox but no write_mailbox extended permission. I'm guessing this is done to prevent spammy apps from flooding friend's inboxes.
You can use Facebook Chat API to send private messages, here is an example in Ruby using
xmpp4r_facebook
gem:This is not possible now, but there is a work around. You can engage with the user in the public realm and ask them to send you private messages, but you can't send private messages back, only public ones. Of course, this all depends on if the user gives you the correct permissions.
If you have given permission to access a person's friends, you can then theoretically post on that users wall with references to each one of the friends, asking them to publicly interact with you and then potentially privately message you.
Get Friends
Post in the Public Domain
Get Messages sent to that user (if given permission)
This thread says you can't do send private messages to a group of friends on facebook but I found this https://developers.facebook.com/docs/sharing/reference/send-dialog
For mobile application i did a solution by injecting javascript in the dialog view. There is a hidden web view in my ios app. That load the fb message send dialog api .. then i inject some javascript to set the "to" and "message" field and submit the form.. So that end user need not to do anything. Message sent to facebook inbox silently...
Sending private message through api is now possible.
Fire this event for sending message(initialization of facebook object should be done before).
to:user
id of facebookProperties
app_id
Your application's identifier. Required, but automatically specified by most SDKs.
redirect_uri
The URL to redirect to after the user clicks the Send or Cancel buttons on the dialog. Required, but automatically specified by most SDKs.
display
The display mode in which to render the dialog. This is automatically specified by most SDKs.
to
A user ID or username to which to send the message. Once the dialog comes up, the user can specify additional users, Facebook groups, and email addresses to which to send the message. Sending content to a Facebook group will post it to the group's wall.
link
(required) The link to send in the message.
picture
By default a picture will be taken from the link specified. The URL of a picture to include in the message. The picture will be shown next to the link.
name By default a title will be taken from the link specified. The name of the link, i.e. the text to display that the user will click on.
description
By default a description will be taken from the link specified. Descriptive text to show below the link.
See more here
@VishwaKumar:
For sending message with custom text, you have to add 'message' parameter to
FB.ui
, but I think this feature is deprecated. You can't pre-fill the message anymore. Though try once.See this link: http://fbdevwiki.com/wiki/FB.ui