facebook app, post to user and notify him - facebook

I've searched for many many hours on this topic through google and also read a lot of questions here, but nothing solved my problem.
I'm making a facebook application, the application has offline_access and publish_stream permissions.
I can successfully post to users' wall.. but the user doesn't get any notification that the app posted to their wall.
I want the user do receive a notification whenever the app on their wall.
also is it possible to make the application post without user's name, (i.e with page name or application name)..
Thanks

you will have to use another social channel to generate
notifications
https://developers.facebook.com/docs/channels/#notifications such
as send a request.
To my knowledge, neither a page or application can post to a users wall. You can however have one user post to another users wall, or a user to a page/app wall.

Related

Posting message to user's wall from C# server app

We are having a problem with the review of our app which needs FB user's authorization to publish a post to his wall (publish_actions permission rejected by FB reviewer). The post is a promo offer developed by some retail store which is generated on server and needs to be put on user's wall.
We are seeing this in many cases by apps that are approved by FB but the reviewer has stated this: 'Make sure the user message area is not pre-filled in any way by the app otherwise the submission will be rejected. This includes hashtags, URLs, and any other text not written by the user.’
What we see in many cases is that the message is pre-filled with text from a publisher so that when its posted to the wall you see an image with some text including a link to the FB page of the publisher. Does anyone know why we are not allowed to do the same?
Prefilling is not allowed. It does not matter if you see it in another App, it´s still not allowed. If you believe an App does it, report it to Facebook.
Also, the user profile is not a place to advertise, each and every single post to the user wall must be written and authorized by the user. You can only add a link with Open Graph tags to it. See the docs for information about all the possible parameters: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed#publish

Does Facebook send notifications to my web page by the fb app?

I have searched on Google and Fb's documentation about this but didn't find anything.
I've already shared content of my page on Facebook with the Share button provided by FB's api and also made an app on Facebook.
Now I want to receive notifications in my page when someone comments the publication or likes it.
I know that I can consult the posts/comments/likes if the user gives me the permissions, but I don't want to do this every 5 minutes. I want that facebook notifies me like a push notification.
How can I do that if it's possible?
Thanks!
After the user shared something on his wall, there is no way for you to get notified about comments/likes on that wall post, unless you authorize the user with user_status or read_stream.
That being said, there is the Realtime API with the feed and statuses fields to subscribe to: https://developers.facebook.com/docs/graph-api/real-time-updates/
That´s probably the best option, although you must authorize the user with the correct permissions too.

What are my options in terms of posting on a user's friend's wall, on behalf of either the user or my app?

I have an app that a user signs up for that needs to then notify a friend of said user about an upcoming event.
I'm trying to figure out what my options are for how to make this work. In an ideal world, my app would would be able to post to the friend's wall with a custom message (written by the user) at some predetermined time in the future. However, I'm not seeing anything in the API for posting on behalf of a user to one of their friend's walls, so, I'm open to suggestion.
TIA
You can post to a user's friend's feed using the Graph API, assuming the user granted you the relevant (publish_stream) permissions.
POST /[friend]/feed
message=hello...
Users generally consider this very spammy behavior for apps, and so it is not particularly recommended.
Source: https://developers.facebook.com/docs/reference/api/post/

How to show a post also on the user stream?

I developed a simple app on Faceobok that posts something on user wall. My issue is that the post isn't seen on wall stream, so he/she will probably never read it.
I developed this app in PHP with Facebook PHP-SDK and to post on user's wall i use: $facebook->api($userId .'/feed/','post',$attachment).
Is it possible to show the post also on user' stream? (Maybe I forget to add a key/value in the attached array...)
Alternatively, is it possible to send a notification to the user in place of post or a notification linking to the wall post?
The post is personalized, so this is why I don't use a facebook page.
Thanks in advance.
Maybe you want to send them an app-to-user request …? http://developers.facebook.com/docs/requests/
But keep in mind that you have to delete these requests yourself, once the user followed them.
Posting on the user stream is not possible (posts are visible just on user's friends stream).
Notification are not allowed, just for requests.

Post on a company facebook page wall on behalf of a user

I have a wp7 app that connect with facebook and lets assume i have the users access token
I am wondering if it is possible to write on the wall of some company facebook page as the user. (i have no ownership of the facebook page and not affiliated with it in any way)
If it is, do you know which permission do i need to obtain ? would love to get any kind of code snippet or a direction i should follow.
Thanks.
it's not possible to write on the wall on behave of the user. You always get a token in the context of a Facebook application - so it will be the app posting on the wall, not the user. And the maximum permission app can ask a user for is publish_stream which allows you (your app actually) to:
Enables your app to post content, comments, and likes to a user's
stream and to the streams of the user's friends.
so in order to post to the company wall, you need to:
Request publish_stream permission from the user
Issue a post request to https://graph.facebook.com/<>/feed url with your message
It's really easy to test. Go to https://developers.facebook.com/tools/explorer, click on "Get access token", select "publish_stream" permission in "Extended" tab, set action to POST, enter "LGUSA/feed" into URL field, click on "Add a field", enter "message: test" and click POST. You will get ID of your post back. See screenshot attached
Sorry this is going to be a bit vauge, but here goes:
First the user is going to have to be authenticated to facebook. There is a good example here. This will give you an authentication tolken to allow you to interact with the API.
The user is going to need facebook permissions to write to the wall. Facebook permissions are described here. I don't know about the specifics of your problem, but with more details I may be able to help more.
then you shoud be able to post to the appropiate wall using the facebook graph api (you'll probably need to be signed up to facebook with a developer account to get to this page).