Can I create an application that provides notification to facebook user when there is a change of user in my application?
I'm building an e-learning that is integrated with Facebook.
You can not send users messages from your application. If this were possible we would see lots of applications sending spam to everyone. What you can do is send app requests to your users when you want to notify them of a change in your application.
You can read more about requests and app requests at this url :
https://developers.facebook.com/blog/post/464/
Scroll down to "PHP example of an app-generated request"...
<?php
$app_id = YOUR_APP_ID;
$app_secret = YOUR_APP_SECRET;
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . $app_id .
"&client_secret=" . $app_secret .
"&grant_type=client_credentials";
$app_access_token = file_get_contents($token_url);
$user_id = THE_CURRENT_USER_ID;
$apprequest_url ="https://graph.facebook.com/" .
$user_id .
"/apprequests?message=’INSERT_UT8_STRING_MSG’" .
"&data=’INSERT_STRING_DATA’&" .
$app_access_token . “&method=post”;
$result = file_get_contents($apprequest_url);
echo(“Request id number: ”, $result);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With