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.
Related
I went through the documentation for creating a chatbot for messenger platform.
All I find there, I need a server, which in the case used as a service for the Facebook platform.
The server also validates the webhook from facebook app.
Now I see, for a chatbot, I need a facebook app, webhook server and definitely a facebook page.
Then I find an application Flow XO, where I only put the page name and the bot is ready.
My question is, how they(flow.xo) can communicate facebook page without a Facebook app(appId, appSecret) and webHook.
My question is, how they can communicate facebook page without a Facebook app(appId, appSecret) and webHook.
They can’t.
They use their server and their app to communicate with the API, on behalf of the users that grant them access to their pages, by providing the necessary permissions when they log in to that app.
Facebook allows to create a Facebook App which integrates multiple chatbots. At Amio, we ask you for permission using Facebook OAuth. When you give us these permissions we send and receive message on your behalf. This allows you to create a chatbot using Amio API without need of creating a Facebook App.
Facebook Page is always needed as this is the entry point of users interacting with your bot. You can check Amio documentation for more detail.
Let's say you have a site that accepts Facebook OAuth registrations/login. Today, the typical pattern is to capture the user's email and send them notifications via that channel. Fine.
Messenger bots have now opened up an opportunity to engage with users directly via Messenger rather than relying on email. In markets where Messenger is heavily used and email hardly ever, notifications via Messenger are a big deal.
Reading the documentation my understanding is that Facebook user id's are application scoped. I wouldn't be able to send a user registered via Facebook's OAuth a message on Messenger.
Has anyone done this? Is it possible or at least being considered in a future spec?
Use checkbox plugin for messenger in web app flow, this is meant for the same purpose!
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 can we send Facebook invites to users of our application?
Usually we receive invites only from friends but not directly from the app itself.
I received an invite from The Sims Social a few months ago and I want to develop the same thing, here is a screenshot:
This kind of request is known as an App to User Request. Only apps that are on Facebook.com or mobile apps can use and send these kinds of requests. Sending them is pretty simple, just make an HTTP POST request to /USER_ID/apprequests with your app access token. You will also want to handle deleting them once they are accepted by the user and reading a list of current requests. They're all documented in the User object docs.
You need to obtain application access token then you can send to the users who are the using this app.
FYI: Authenticating as an App
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.