Post notification that user is using my application - php

If i have a facebook application with name "abc", how we post to facbook ticker that "user_name is using ABC" when a user uses my application.
i use graph api to post photos. but if i post same message as status to users wall like above sentence, facebook takes it as spam. Right ?
so how to tell user's friends that this user is using "abc" ? i saw when some people play games similar notification is shown in ticker.
how is it done?

This is not spamming unless you are literally spamming everyone's wall. As long as you are
just posting a singe line of status "user_name is using ABC" once or twice a day, you are fine.
Here is link from facebook dev's docummentation to post status messages.
https://developers.facebook.com/docs/reference/api/post/
Further more, it is always recommended that you read policies yourself before implementing any api.
https://developers.facebook.com/policy/

Related

App request/Invite through Facebook API using PHP

I'm building an app and the client wants the following logic:
User logs in to the app.
User selects a Friend.
User selects a gift that the User will send to his Friend.
User writes a message to his Friend.
Friend receives a SECRET notification about the gift.
With "SECRET" I mean that Friend will not be able to see WHO is the User that sent the gift.
So the concrete question is how to send a notification to the FRIEND without a clue about the USER that sent it? I think is not possible but I want to be sure and check with the experts.
And if it's not possible, what do you recommend to accomplish something like this? Should I use the app request dialog and hope that the Friend will see it? Is there any other FB API tool I can use?
I really appreciate your help.
What you're trying to achieve is not possible with FB's API. As explained already by #CBroe.
You can send a request notification if the user uses your app. However, You can do one thing but that won't be completely anonymous.
You can send the friend a notification from the user and make it just an invite to try the application and after the friend uses your app (authenticates), your app can then send a notification and say someone left a SECRET message for them. This could be after few hours or instant, Whatever you/your client prefers. However as i said, this won't be completely anonymous nor it's hard to guess who left the message unless the friend isn't smart enough to know who that could be.
With the beta Notification API something similar would be possible, but only if the receiver has authenticated your app: https://developers.facebook.com/docs/games/notifications/#impl

Which of the Insights shown in a Facebook Page are available through their API?

I would like to get the insights data from my page on Facebook as can be seen from https://www.facebook.com/USERNAME?sk=page_insights . However I do not know which of these are available through the API, except of "number of fans" and "talking about".
I have print-screened the insights of my page and posted it as an album for better understanding here: http://imgur.com/a/hrL9z
Below is all the insights shown on the facebook page, so I will get a clear answer.
Thank you.
*Because the subject is similar to twitter api, how can I get the numbers of retweets made from my statuses each day? (answered)
Total number of fans.
Total number of friends of fans.
Weekly total reach.
People talking about this.
LIKES (https://www.facebook.com/USERNAME?sk=page_insights_likes)
Demographics
Gender
Age
Country
City
Language
Where Your Likes Came From.
New Likes
Unlikes
Like Sources
REACH (https://www.facebook.com/USERNAME?sk=page_insights_reach)
Who You ReachedGenre + Age
How You Reached People.
Reach -> Organic, Paid, Viral, Total
Unique Users by frequency
Visits to your page
Page Views,
Unique Visitors
Total Tab Views
External Referrers
TALKING ABOUT (https://www.facebook.com/USERNAME?sk=page_insights_talking)
Who Is Talking About Your Page Genre + Age
How people are talking about your page
Talking about this
Viral Search
Information about the insights data available through the Facebook Graph API can be found here.
The Page, Application and Domain objects have an insights connection of this type. Post objects also have this connection where the Post was made by a Page.
Available metrics include application and page hits, adds, removes, and likes.
Note that you require the read_insights permission for the page.
Here is an example API response (with read_insights) for a test page I just created. All of the information you posted in the question would be there (except that the page has no users, so there won't be any proper data).
You can test this with one of your own pages using the Graph API explorer:
Use https://graph.facebook.com/YOUR_PAGE_ID/insights/ as the URL.
Get an access token with read_insights (on the 'Extended Permissions' tab) checked.
Twitter supplies an API to get the list of all your retweeted statuses:
https://dev.twitter.com/docs/api/1/get/statuses/retweets_of_me
If you poll that once a day, you should be able to get the updates with one or two API calls, which shouldn't impact your rate limits significantly.

Facebook notification on third party software

Is there a fb api that allows user to get fb notification or latest wall post by friend on their own website? this means that the software will requires user fb credential.
If you are trying to create your own site that gets data from the users latest wall posts, you can use the Facebook Graph API https://developers.facebook.com/docs/reference/api/
To pull most recent wall posts (in JSON format), use:
https://graph.facebook.com/me/feed?access_token=<UserTokenHere>
The Facebook Graph API site above gives lots of good info on how to use this. If you are trying to do something else, please clarify your question.
Cheers!

Facebook API. Notification via social plugin comments

I have a page with a comments social plugin, I would like to know if it's possible to notify users who have already commented on the form.
I can subscribe to the comment.create function, but how do I send notifications?
I know actual notifications are now impossible, but is there another way? (Sending a message from the user perhaps?). With the format of my page, they will want to know when someone has posted.
I haven't tried that, it's just an idea.
https://developers.facebook.com/docs/reference/plugins/comments/ - look at the section describing way of getting comments via Graph API.
E-mail way:
You can ask each user who logs into your site to allow you to get his e-mail address. Then, you would subscribe to this event, list users who commented an article and send them an e-mail.
Message way:
You need a Facebook page for your site. Then you would receive a token for this page (manage_pages permission), get publish_stream permission in behalf of this page and publish message to streams of users who commented.
It may be also possible to send user a message on behalf of a page using Graph API, however I haven't seen anything like that in docs
This is not allowed by facebook, the attempt will result something like this:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException"
}
}
This is because the social plugins do not "live" inside facebook, they are being distributed to 3rd party sites, and to prevent bad content posted from bots/apps to display in 3rd party websites, facebook has disabled this option.
Search for WordPress Plugin called Ultimate Facebook Comments Email Notify. I hope it will solve your problem...and you can also take some idea from his script which he is using in the plugin....hope this helps :)

post message to facebook news feed

I am running an ecommerce website in php. When facebook connected users make a search or post a sale, I want it to automatically post messages to the user's facebook news feed. I wonder how i could do it? any articles I can read about?
Thanks,
For that you need to take publish_stream permission from user. Read this

Categories