I saw your post about sending messages to your Facebook friends via the IOS Facebook sdk,
I was wondering if there is a way to send a private message as well to these friends.
If not, is sending messages to your Facebook friends still supported from your previous post at:
iOS Development: How can I get a Facebook wall post to show in the friend's news feed?
If so let me know, thank you in advance
It is possible to send a private message via facebook- just not with the SDK. You can get the user's 'username' (ie. http://www.facebook.com/username) and you can send them an email via your app to 'username#facebook.com'.
Shapow!
Major bonus: attach a file and it will be included in the facebook message.
One caveat: the email will not reach the recipient's message inbox unless the sender's email address is affiliated with a valid facebook user account. I would imagine this is in place to thwart spam.
No, it is not possible to send private messages using the Graph API.
Yes, it is still possible to post to a friend's wall. I just checked it out just now using the graph API Explorer tool: http://developers.facebook.com/tools/explorer. I used /friendId/feed with an HTTP post of "message" = "testing" and my friend confirmed they saw it on their stream.
let messageDialouge = MessageDialog.init(content: <ShareContent>, delegate: nil)
if messageDialouge.canShow {
messageDialouge.show()
}
And do add fb-messenger-share-api inside the LSApplicationQueriesSchemes in info.plist
Related
I am trying to call following Twitter's API to get a list of followers for a user.
http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username
And I am getting this error message in response.
{
code = 215;
message = "Bad Authentication data";
}
I can't seem to find the documentation related to this error code. Anyone has any idea about this error?
Your request lacks authentication data. I got that error when I simply clicked on http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username. This is not the way to access twitter API.
Create a Twitter app from https://apps.twitter.com/. Then, try using a Twitter API Library to access REST API. If you are comfortable with using ruby apps on command line interface check out https://github.com/sferik/t. Set it up and then try t followers [USER] for listing all followers of USER.
You will have to use OAuth. More info can be found on Twitter website. Here: https://dev.twitter.com/oauth
This error is coming because your Twitter developers account is not approved. Now-a-days you can't make app without getting your developers account approved from Twitter.
To make an app, you need to contact Twitter and apply for developers account. If you are lucky engough, you will get approval although this process may take months.
If you just need the data, go for third party services like followersanalysis[dot]com, birdsonganalytics[dot]com
How do I send a facebook app requests from one mobile user to another using the Graph API?
I have looked at facebooks documentation but the only options I have found are to A) send an app to user message from the app (which I can't get working) or B) to use the request dialog, which doesn't seem to let me send a request to a single user.
FB has instructions for how to build a custom "Multi-Friend Selector" but apparently not for mobile.
I have tried using HTTP POSTing to
https://graph.facebook.com/%s?access_token= ...
with POST data set to
message='Test Message'
but I get
WWW-Authenticate: OAuth "Facebook Platform" "invalid_request" "(#2) Failed to create any app request"
I have also tried in the Graph API Explorer but I get the same thing.
I don't want to send these messages to users that have installed the app and I don't mind the user having to provide confirmation for the FBFrictionlessRecipientCache. Also, my app is in Sandbox mode, but I only need to send the requests to the other developers.
I am looking for anything that will let me do multi-friend selectors or ask for lives, or get help from a friend, like I see in several mobile games these days.
You can use presentRequestsDialogModallyWithSession from FBWebDialogs.
You must specify a "to" parameter to identify the recipient, and you must use the FBFrictionlessRecipientCache.
The "to" parameter identifies the recipient. It stops the select user dialog from appearing.
The first time you send the request to each recipient the user will have to grant permission. After that, the FBFrictionlessRecipientCache will allow the request to be sent relatively silently (a dialog pops up briefly and goes away by itself).
I always get this message "Please visit http://bit.ly/instacomments for commenting access" when I use the endpoint /media/media-id/comments (see http://instagram.com/developer/endpoints/comments/) to post a comment to a friend's post in my iOS app, I requested these scopes from Instagram: scope=likes+comments+relationships.
I visited the web page mentioned in the error message and filled the form, months ago and not only once, but no lucky.
I also sent email to apidevelopers[at]instagram.com for access, still no lucky, and no response.
Anybody knows what w should I do?
You have to make a request to Instagram to get access to posting comments through the API. The email address is in the developer documentation. If you follow the link you are receiving in the error, it will take you to the page to request access.
Is there any way to post a Facebook application invite from Ruby on Rails, e.g. by deploying Koala?
Looks to be impossible at the glance. Any workarounds other than simply posting to a wall?
Actually mikeonrails gave a correct link - the Requests dialog is the way to invite friends to your app and send them other types of requests. It does require user interaction though (just as the video shows), for requests sent to users who don't have the application installed.
And now for the details. There are 2 types of requests that you can send:
user-generated requests: these can be sent to users who don't have the application installed (ie. application invite). They can only be sent using the Javascript SDK (or the iOS or Android SDKs but I don't think you're interested in those) and they do require user interaction. It will consist of a pop-up that will either display a selection (made by you) of his friends or a friend selector and a send button to send them your message.
app-generated requests: these can only be sent to users who have the application installed, but can be sent without user interaction.
The code for user-generated requests is like this (using the Javascript SDK):
// this will show the pop-up dialog with a friend selector
// add a `to: 'friend_id1,friend_id2` to skip the friend selector
FB.ui({
method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
For the app-generated requests you can use Koala like this:
user = Koala::Facebook::API.new(user_token)
user.put_object("user_with_app_installed_id", "apprequests", {:message => "Would you like to be friends?")
So, the conclusion is that you cannot invite a user's friends to your application without his approval, but you can make it really simple for him to do it (2 clicks).
If you'd like to read more:
Requests Dialog: http://developers.facebook.com/docs/reference/dialogs/requests/
Social Channels: http://developers.facebook.com/docs/channels/#requests
You can use Facebook Chat API to send private messages, here is an example in Ruby using xmpp4r_facebook gem:
sender_chat_id = "-#{sender_uid}#chat.facebook.com"
receiver_chat_id = "-#{receiver_uid}#chat.facebook.com"
message_body = "message body"
message_subject = "message subject"
jabber_message = Jabber::Message.new(receiver_chat_id, message_body)
jabber_message.subject = message_subject
client = Jabber::Client.new(Jabber::JID.new(sender_chat_id))
client.connect
client.auth_sasl(Jabber::SASL::XFacebookPlatform.new(client,
ENV.fetch('FACEBOOK_APP_ID'), facebook_auth.token,
ENV.fetch('FACEBOOK_APP_SECRET')), nil)
client.send(jabber_message)
client.close
UPDATE: Facebook chat API has been deprecated so it is not possible to use this solution anymore.
I saw your post about sending messages to your Facebook friends via the IOS Facebook sdk,
I was wondering if there is a way to send a private message as well to these friends.
If not, is sending messages to your Facebook friends still supported from your previous post at:
iOS Development: How can I get a Facebook wall post to show in the friend's news feed?
If so let me know, thank you in advance
It is possible to send a private message via facebook- just not with the SDK. You can get the user's 'username' (ie. http://www.facebook.com/username) and you can send them an email via your app to 'username#facebook.com'.
Shapow!
Major bonus: attach a file and it will be included in the facebook message.
One caveat: the email will not reach the recipient's message inbox unless the sender's email address is affiliated with a valid facebook user account. I would imagine this is in place to thwart spam.
No, it is not possible to send private messages using the Graph API.
Yes, it is still possible to post to a friend's wall. I just checked it out just now using the graph API Explorer tool: http://developers.facebook.com/tools/explorer. I used /friendId/feed with an HTTP post of "message" = "testing" and my friend confirmed they saw it on their stream.
let messageDialouge = MessageDialog.init(content: <ShareContent>, delegate: nil)
if messageDialouge.canShow {
messageDialouge.show()
}
And do add fb-messenger-share-api inside the LSApplicationQueriesSchemes in info.plist