send message to all friends on facebook and twitter - facebook

I want to send a pre-defined message to all friends on Facebook and twitter. Once the user log in. I will pass username and password. And I know i have to use different apis for both Facebook and twitter.
But I don't know which apis to be used and how to implement this functionality. Please explain as I am new to objective C.

Facebook doesn't allow pre-filled messages. This is against developer policy. The user must manually fill out the message.

Related

How to get the fb and g+ email programmatically in ios?

I have integrated fb and g+ login for my ios app. and If phone already sign in with the fb its automatically log in when click the fb button. But I want to send the email of the user in fb and g+ to the server separately. Can anybody tell me how can I get the email from fb and g+ both.
Thank you
You won't get any user data (profile, birthday, email, etc.) without requesting specific permission from the user. It's a matter of following the SDK guide really.
You can request a user's information by making a me request. And you can do this in two ways:
Using the FBRequestConnection startWithGraphPath:completionHandler: method, like you did in the requesting permissions section, and setting the path to me.
Using the FBRequestConnection startForMeWithCompletionHandler: method, which will make a me request directly.
https://developers.facebook.com/docs/ios/graph
It's hard stuff that you will need to go through as a developer. Following how others did it by code will help you. But reading through the SDK guide will make you understand better.

Facebook - Send Message To Friend(s) with / or without API in PHP / cURL?

Apparently with the Facebook API, you can only read a users inbox, not send messages. Without doing a Javascript send dialog.
I am creating a simple script with twilio where I can call in, and save a message. Then have that message be emailed to a friend, or myself.
That's done, and easy, but people don't check their emails that often as they check a Facebook message.
Question:
Is it possible with the Facebook API, or using cURl or some other method in PHP to automatically login into my facebook account, and send a message to a friend?
My personal facebook, not anyone, but have my email and password passed into it and have the script do this automatically?
Is this possible, or against Facebooks TOS to have php remotely access and use my FB account?
If someone were looking for a similar solution today, they can request access to integrate Twilio with the Facebook Messenger API here.
If you send an SMS with Twilio, for example:
https://www.twilio.com/docs/api/rest/sending-messages
https://www.twilio.com/docs/api/rest/sending-messages
from twilio.rest import TwilioRestClient
# put your own credentials here
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
AUTH_TOKEN = "[AuthToken]"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(
to="+15558675309",
from_="+15017250604",
body="Hey Jenny! Good luck on the bar exam!",
media_url="http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg",
)
You would then be able to integrate with Facebook Messenger with little change to your Twilio code.
You can try Nimrod : https://www.nimrod-messenger.io/
Your friends will have to register and give you their API keys if you want to send messages to them.

How do you post a link to user's inbox in Facebook?

I am a iPhone application developer. I don't know how to send an "link" to a selected user's inbox in Facebook from my Facebook account.
You can't send messages using a Facebook API from the backend, but you can do through JS SDK or redirecting user to facebook url as per this link
FYI: Send Message
I don't exactly know if I understood your question, but: If you want to provide a link that a user follows in order to go to her/his Facebook inbox, you can use the URL scheme fb://mailbox (provided that she/he has the Facebook app installed)
As #Venu wrote, the api does not allow apps to send messages on the behalf of the user, only with the Send Dialog which you should be able to open using the iOS sdk Dialog.
Another approach you can use is the Chat API with which you can send messages on the behalf of the user, it requires the xmpp_login permission and you to implement an xmpp client.

How to get user e-mail addressess that clicked like button for blog entries or pages with Facebook Open Graph Protocol?

I have implemented Facebook Open Graph Protocol Full Integration following the http://developers.facebook.com/docs/opengraph/ and http://www.websitedesign411.com/blog/facebook-open-graph-protocol-full-integration-walkthrough.
How can I get user e-mail addressess that clicked the like button for certain blog entries or pages?
You can't. Access to the email address requires prompting the user for extended permissions. You can't get that information through a simple "Like" action. That would be a spammers dream!
http://developers.facebook.com/docs/authentication/
I don't believe you can access a facebook user's email address just because they clicked on your Like button. What you will need to do is get the user to authenticate to your application using facebook connect (usually by clicking on that blue "Connect" button), and in the process you can prompt them to share their email address. Email is an 'extended permission' so you need to ask explicitly for it.
You can implement this authentication bit easily enough with the facebook javascript SDK:
http://developers.facebook.com/docs/reference/javascript/
Once the user has authenticated to your application allowed access to their email you can can fetch their email address via the graph api:
http://developers.facebook.com/docs/reference/api/user/
The easiest way to communicate with folks who like your page is to post interesting messages on your page's wall leading them to your facebook app.
You then get them to authorize your app (with or without extended permissions).
Once authorized, you are able to communicate several ways like:
using livemessage
http://developers.facebook.com/docs/reference/rest/livemessage.send/
create an event and add their user id to it.
BTW, the way to get their user ids is:
1) getting the object id of your page/url using
https ://graph.facebook.com/?id={URL}
2) retrieving the user ids via
https: //graph.facebook.com/{mypageid}/likes

How to contact Facebook Connect users through Facebook's API?

We have users that logged in to our website through Facebook Connect. Now we'd like to contact those users about changes as we indicated in the signup process, but we don't have their email addresses. Only their Facebook ids.
How can we contact them? I understand Facebook removed 3rd parties' ability to send notifications through Facebook's API. We can send them a message through the API either.
So I guess we're left with posting to their wall from a user account of ours. I assume there's a low limit to how often we're allowed to do that and is that even permitted? Or we can make an application request from this designated facebook user account which would show up in their notifications.
Finally, we could manually go to the user's profile page and then click the "send a message" button from our facebook user account... A lot of manual work and I assume this is frowned upon as well. Is there an easy way to find out the profile page URL from a Facebook id?
What's the best approach here where we don't break any rules?
If you are getting stream_publish extended permission in your profile then you can simply post on there wall see this http://developers.facebook.com/docs/reference/rest/stream.publish/
Alternatively this can be a better solution if the user do not granted any extended permission
http://developers.facebook.com/docs/reference/rest/livemessage.send/
you should get "offline_access" from the facebook user requests to post at anytime.