I want some way to send personal messages on facebook by Native iOS app. Personal in sense of it shouldn't be a wall post only intended person can see the message. We have tried to find the solution and we got the following solution but each one has problems.
- Facebook Notification(Currently in beta mode) : This is only for web canvas app not for native iOS app.
- App request : We are able to send message to a person. But facebook is not showing any notification in notification area for it. User can see this messages at "Games/Requests" but what we want is notification should be generated for it and it should be mobile compatible means iPhone should be able to get notification if FB account is configured.
Any help will be appreciated.
Three options for you, none brilliant:
Use the send dialog in a hidden web view using the URL form and use stringByEvaluatingJavaScriptFromString to populate the text field and fire the button.(https://developers.facebook.com/docs/reference/dialogs/send/). They do say that this is not for this so they might shout at you if they find out.
Use the chat API (https://developers.facebook.com/docs/chat/). That means you connect via XMPP and a message will either popup in the chat window or end up as a message if they are offline. You can do this straight from the device - I did this once and it was horrendous but did eventually work. Better IMHO would be to send a HTTP request to a server and PHP your way into Jabber as the FB sample shows.
You can apparently email [fb username]@facebook.com and it will pop up as a message. You can use the standard Opengraph call to get the username.
Martin
I have already figure out but late in answer to question. After the lots of searching on google I found that we can achieve this using ChatAPI.
I found one source code on github : https://github.com/KanybekMomukeyev/FacebookChat
In this code you can see implementation of chatAPI.
@Martin has given all three good solution but 1 & 3 second option was not working. 3 option was giving error in sending email. But I personally feel that 2 option is really good. It should be the solution.