-1

I need to send a Facebook new message using Facebook PHP sdk or Javascript sdk. This message should be attached a link for a Facebook app. please check this image, Then you can understand about what I exactly want.

New Message with Link Attachment Image

Please anyone can help me?

Lix
  • 47,311
  • 12
  • 103
  • 131
dmttk
  • 81
  • 2
  • 8

1 Answers1

2

This is not currently possible. Applications are prevented from sending private messages to their users (or any users for that matter) because it would be a serious vulnerability for spam.

One Alternative

would be to request the email permission from your applications users and then using

you'll be able to request the email of the user and send him an email using some code on the server.


You can read more about requesting permissions for facebook applications at these links :

https://developers.facebook.com/docs/reference/api/permissions/
https://developers.facebook.com/docs/authentication/

Another Alternative

would be to utilize facebook dialogs and initiate a 'request' or 'apprequest' dialog. For this you'll need to implement the Facebook JavaScript SDK and the Request Dialog.

The Request DialogThe Request Dialog






When you initiate this dialog you can specify a message to be sent along with the request. When a user responds to one of these requests they are redirected to your application.

enter image description here
(source: fbcdn.net)

Community
  • 1
  • 1
Lix
  • 47,311
  • 12
  • 103
  • 131