Facebook graph, post action with extra parameters - facebook-graph-api

I have created an application with their associated Open Graph actions. Got problem with submitting one action, which is using extra field "message". When admin or tester using this action it works fine, but it is not working with facebook's test users, such is "Auth Dialog Preview User", it gives an error "Message: This action is not allowed to set a user message because this property was not requested for approval." Why it gives this error to the test user? And when i submit this action, facebook replies me that they can not test this action... What i missed?
http://gyazo.com/42ebb0a5c12f3c47fed64f5eb9930f61

Why it gives this error to the test user?
Doesn’t it quiet clearly say so:
"Message: This action is not allowed to set a user message because this property was not requested for approval."
…?
Users that are not admins can’t post actions that have not been approved by Facebook.

I've been beating my head against the wall on this problem as well.
First: There is a Facebook Bug that is currently triaged on this topic.
Facebook Bug Link
Second: I noticed Facebook has updated the description of the Message property.
message: Allows users to write a personalized message attached to this
action. You can only use user message when the text is entered by the
user (not pre-populated). string
Facebook page that details the Message parameter
You'll notice it clearly states that it can't be pre-populated now. I don't remember it saying that previously (Of course my memory could be failing me) and I'm curious if that means even if the user composed the message on my application, Facebook considers the string I'm feeding the action pre-populated even though it's an actual unique comment written by the user. In other words you may have to use Facebook code (plugin, dialog, etc...) to prompt the user to actually enter a message attached to the action.
Third: FYI, I was able to get my action approved (With the Message parameter) but the same error persists for all users attempting to submit the action with the exception of admins and testers, so getting your action approved won't likely alleviate the issue. It's either an actual bug or a misunderstanding of the capabilities/functionality of the Message parameter.
Apologies for this being a partial answer slash extension to the question.

Related

How can I use FB.ui to post a user story?

Currently, the below FB.api function is invoked on a click event and posts a user story on the user's timeline (the FB app is in sandbox mode right now and the user story is still pending review):
FB.api( // creating the user story
'/userid/mynamespace:myaction',
'post',
{
myobject: fbObjectId, // retrieved in an earlier FB.api call
access_token: accessToken, // retrieved in an earlier FB.getLoginStatus call
message: customTextFromUser, // prefilled by my app (FB doesn't approve of this)
image: ImageURL, // prefilled by my app (FB is OK with this I think)
'fb:explicitly_shared': true // requires that I take the user out of the normal flow of the app which is why I want to show a modal first
},
function(response) {
// handle the response
console.log(response);
if (response.id) {
alert("Success! The user story has been shared on Facebook!");
} else {
alert("Woops! Something went wrong sharing the user story on Facebook. Please try again.");
}
}
);
What I think I need to do is show a modal dialog box such as in the case of when FB.ui is invoked to give the user an opportunity to add a User Message and then post the user story along with the User Message (if any).
Will I need to create my own custom modal dialog box or can I use FB.ui in some way to achieve this?
Note: The above API call works fine in my tests. Granted, variables such as mynamespace, myobject, and myaction have been obscured in the above code sample.
My real problem is the user story is just not being approved by Facebook because I supposedly need to "take the user out of the normal flow of the app" in order to Explicitly Share the user story with an additional optional User Message. I guess I need a strategy to address this issue rather than a specific code sample answer.
Here is the latest feedback I got from Facebook:
Your action doesn’t follow section IV.2 of the Platform Policies:
https://developers.facebook.com/policy/.
Words in the user message field must be manually written by the user
and can’t be pre-filled by the app, even if the user can edit or
delete the words. Learn more about user messages:
https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#usermessages.
Posting explicitly shared content needs to be optional for users. A
sharing control needs to be in-line whenever a user shares something
and it can’t be in a separate settings area. The content should have a
user-generated component or the user needs to be taken out of the
natural flow of the app in order to decide to publish the story back
to Facebook. Your current action integration shouldn’t be labeled as
“explicitly shared.” Learn more about explicitly shared content:
https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#explicitlyshared.
If you use a test user created for your App, or use your developer account, you should be able to see the story published before it's approved.
The API call you're making also needs to be updated slightly. Instead of using User ID in the FB.api, just use /me/mynamespace:myaction. The access_token also doesn't need to be included, as it's automatically passed by the call providing the user is logged in.
Finally, is your object actually called myobject? The name must match the settings you entered for your story, e.g. 'article` or another valid type.
To help debug the issue, try a simple API call first (e.g. remove message and image) and see what happens. Then add the other parameters back one by one to see which one is causing the issue.
Edit
To get the action approved, you need to make sure the user is entering a custom message in one form or another - usually via text input on the page. If you are sharing pre-defined text the user hasn't entered, facebook won't approve it.
If you want to share a pre-written message, it might be better to share it in another way, like a caption in the story itself.

Facebook Graph API: Explain permissions to user?

Is it possible to ask for the wanted permissions and displaying some individual text in the permissions-dialogue that's showed to the user? E.g. "We use the permission to read your mail address to create a new account in our community."?
Thanks,
indect
Earlier the Login Dialog would have the option to display the app description that developers could use to inform the Users about the need for the specific permissions. Which looked like following and was described in this blog post
But the Login Dialog has then seen few modifications, as outlined by this blog post for grater clarity and control due to which the Login Dialog has changed to its current form which has no option for the developers to inform Users about the request. If you want to inform about it, do it prior to sending the User to authorization, as the new Login Dialog looks like
No, these messages are default by the facebook.

Some feed messages return false in graph

I have tried posting to some different friends feeds. Sometimes the message does not show up on feed even if a get a "good" response back with a new graph api ID.
100002842168248_146917358746335 does not work for example
I don't get any errors or similar only a new ID for the post and when I try to access via graph api (developer console on FB) it return simply false?
https://graph.facebook.com/100002842168248_146917358746335
Using the same call but for another user is showing up on facebook feed without problems. Is there any more action I can take or should I simply take my "false" and give up.
It's probably a privacy/permission settings issue. If the user who's Wall you are posting too has it set so only Friends can view their Wall, you will not be able to view the post (via the Graph or otherwise) - even though your App made the post.
You can also get 'false' if, although the post is visible on Facebook.com with no problems, the user who posted it has opted out of Facebook Platform. This is a privacy setting which disables any apps from accessing any information about a user, their posts, etc.
Even if their posts are 'Public' on facebook.com, the API won't return anything about such users.

email id of user from new facebook API

I have worked earlier on facebook API. I successfully used it and fetched all friend lists with their email ids. I was also able to get user email id who logged in through facebook API.
Now in gap of 7-8 months I found that faceAPI development section has been changed . New one is something different.
And now I am facing problem to get email id after user login at facebook.Yet all other details are coming like user name .user id and location except email id.
Old script is also not working with me. Could you help me to get email id of user who get login by facebook at my website.
Thanks for your cooperation.
No one will do your homework (upgrade the code for you)
Read the most current documentation
Accessing users e-mails require a special permission email
Users may choose not sharing their direct e-mail with you
You didn't say what technology you are using, but you can check the PHP-SDK example page to get started.
Direct Access Method:
Log into Facebook under your name. If you need an "Access Token", Click on the Extended Permissions and click the "read_friendlist" check box to get your Access Token and then
submit your query. You may need to "Allow" access, so just follow the prompts given.
Voila! You now have the usernames for everyone on your Friends List. The "username" parameter in the query will give you the contact email "message to that person" and you append #facebook.com and send them a message. Very simple.
http://developers.facebook.com/tools/explorer?fql=SELECT%20username%20FROM%20user%20WHERE%20uid%20IN%20%28SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me%28%29%29%20ORDER%20BY%20name
I had been using the import function in Yahoo Mail but now it has been limited to the first 50 names on your friends list. Where I work, they have over 6,000 friends between the two pages. This is a very simple solution to my problem. And now I can write a very small PHP sendmail program and send EVERYONE on the friends list an email message that goes directly to their messages. No more viewing page sources or manually doing this.
I can create a special email list on IFanz that will handle all dups, even if I repeat this process on a monthly basis to acquire new emails.
-SAB

Actions do not appear on timeline

I'm developing an app which publishes actions to the timeline.
On the app settings, I've created the action "post" and use the built in object type "article".
Although my graph actions have not been approved by facebook, that should not be a problem, because I am logged in as the developer of the app.
My article URLs pass facebook's linter with warnings, but no errors.
When my app notifies facebook of the the post action, it appears to succeed. Facebook returns an ID representing the action.
When I use facebook's graph explorer to view that ID, the data appears to be correct, showing the correct action type and object data. (If there's a URL to browse the action on facebook, instead of the graph explorer, I do not know what it is).
Still, with all the above apparently working without errors, I never see the action on my timeline. Whether I browse my own timeline, or when logged in as a friend and another developer of the app, I never see any indication on facebook.com that the action was performed.
What am I missing to make my custom action appear on my timeline page?
I had a similar problem. I was using OG and I could post everything successfully, but the posts didn't appear in timeline, but only in the activity log in Facebook.
I just went to the settings of the action and set "Explicitly Shared: This action can specify the user explicitly shared an action." to ON.
Then in my piece of code I put "true" to the key "fb:explicitly_shared" while creating the OG object.
If no error is being returned it sounds as if there is an issue in your public page that is preventing Facebook from knowing what to post.
Have you double checked your OG: meta tags through Facebook's validation tool [ https://developers.facebook.com/tools/debug ]. While you need all of the values to be filled in, the type bit is the most overlooked and must be setup properly to link to your particular application and corresponding action.
If your OG: data is correct and validating you should also check the detail settings for your action and aggregations. If the phrase / tense bits are not filled in Facebook may be uncertain how to make your post appear back to on the timeline.
Discoverd the problem....
My article page include an article:author tag. The URL in that tag was not visible to anonymous users. So, I'm guessing, facebook visited that author URL and received a HTTP 403.
When I removed the article:author tag, the items started appearing on my timeline.
So be careful with all tags and put all urls through facebook's debug tool.
Hmmm Interesting
Was having the same issue...
Using the XFBML, fb:like with all required og meta tags validating on the linter.
Last month when I liked a 'product' on my website, the post was published on my fb timeline wall no worries. Nice, perfect!
Today after clicking Like, I noticed it wasn't publishing to my timeline wall at all... but was logged in the Activity Feed.
It did however post to my wall if I commented on the Like Button flyout comment section.
Then I found this
"Pages of type article do not have publishing rights, and will not show up on user's profiles because they are not real world objects."
https://developers.facebook.com/docs/opengraphprotocol/#types
I've been getting the same issue with a feed dialog post. The posts can be navigated to directly, but doesn't show on timeline. More details here:
Actions not appearing on timeline
I had a similar problem, but everything was actually working correctly. If you get a returned ID and your article appears in your RECENT ACTIVITY, then all should be good.
The perceived issue, your post not appearing in your timeline, is actually the correct behavior. Your post doesn't appear in your timeline because it should appear in your friends' timeline as an activity that you completed. Once they comment or like it, then it should reappear on your timeline.
For me the issue was the posts doesn't show on timeline for all users except me also it was public !, i fixed it by make turn on application as online to be available to all users