Make a facebook achievement visible in timeline - facebook

I can successfully publish a Facebook Achievement, but it only apears on my activity log.
There I have the option to change its visibility from "Allowed on timeline" to "Shown on timeline" or "Hidden from timeline".
When I change it to "Shown on timeline" it apears on my timeline, and that's the default behaviour I'd like to happen.
How can I change the default behaviour to "Shown on timeline"?
I'm using Unity (latest version: 5.4.2) and Facebook SDK for Unity (latest version: 5.1).
This is the relevant piece of code:
var query = new Dictionary<string, string>();
query["achievement"] = achievementUrl;
FB.API("/me/achievements", Facebook.HttpMethod.POST, callbackfunc, query);
Also, I wanted something similar for the Score, but in this case it is even worse.
When I publish a Score it just says in the activity log that I was playing game X - it doesn't even say I have a new highscore.
The code:
var query = new Dictionary<string, string>();
query["score"] = scoreString;
FB.API("/me/scores", Facebook.HttpMethod.POST, callbackfunc, query);
[Edit] - The score "story" is apearing in the activity log as well after all, so the problem is exactly the same as the achievements.

Facebook says:
This behavior is intended for the Achievement story and it's not meant to be shown on Timeline.
I recommend moving away from these implicit stories and integrate explicit stories where the user decides how and when to share back to Facebook.
Here's a guide on how to implement explicit sharing: https://developers.facebook.com/docs/opengraph/using-actions/v2.2#explicitsharing

Related

Jive - Get current blog post from app

I'm developing an app which has a Content Action and an !app Action.
I would like to get via javascript (i.e. Open Social API I suposse...) the current user (I got it!) and the current blog post (blogpost id) from both actions.
Is it possible?
Thank you!
I found it!
You can do it adding an gadgets.util.registerOnLoadHandler() listener, and inside it you should call the osapi.jive.core.container.getLaunchContext(function (selection) {});
From selection object you can get the type and the id:
var type = selection.jive.content.type;
var contentid = selection.jive.content.id
You have a full example from Jive Developers Website

Unity3d Facebook AppRequest filter

In my Unity project for IOS i use
FB.AppRequest(
message: "somedesc",
title: "sometitle",
callback:appRequestCallback );
I want filter and show only friends who don't install app, but filters = ["app_users"] and
excludeIds = "someIdValue" not working
How solved this problem
(I use Facebook Unity SDK, https://developers.facebook.com/docs/unity)
You can use this:
// "app_non_users" will list friends that haven't installed the game yet
List<object> filter = new List<object>() { "app_non_users" };
// Then, call the API with this filter. Enjoy!
FB.AppRequest("Test Message", null, filter, null, 0, string.Empty, string.Empty, this.HandleResult);
In the examples that are provided within the Facebook SDK for Unity, there's a scene called AppRequests. From there, I've seen a class named AppRequests.cs, in which you can find several examples on how to use these app requests.
Note: To try this examples, make sure to add all FacebookSDK provided scenes to your build settings scenes. Test them in device.
FB Unity SDK documentation says that filters are currently supported:
Filter are currently not supported for mobile devices
You should probably get list of friends first with a request like this with FB.API method:
FB.API ("/me/friends?installed=false", HttpMethod.GET, Callback, null);

facebook js sdk notification callback response changes?

Just a quick question to make sure i'm on track -
I've started supporting a ready FB app.
Yesterday the client reported an issue with a part of the app which uses the fb JS SDK notification plugin.
In the callback the code refers to (this is only the callback of the entire FB.io):
}, function(res) {
if(typeof(res)!='undefined' && res != null){ // if user invited friends
var ids = res.request_ids.toString();
but when I console.log the res object, there is no res.request_ids - onlt res.request and res.to (which contains the IDs).
Can it be that Facebook changed the response object? I could find the official docs which say that i'm correct about the object - there are 'request' and 'to' properties, no request_ids - but why would it work till now? was there a change in the response object? is there a place where these changes are published in advance in order to prevent downtime?
Thanks...
"Can it be that Facebook changed the response object?"
Yes, they announced the change February of last year. http://developers.facebook.com/blog/post/464/
"*I could fin"d the official docs which say that i'm correct about the object - there are 'request' and 'to' properties, no request_ids - but why would it work till now?*"
Official documents:
https://developers.facebook.com/docs/reference/dialogs/requests/
http://developers.facebook.com/docs/channels/#requests
"Was there a change in the response object?"
Yes, see: http://developers.facebook.com/blog/post/464/
"is there a place where these changes are published in advance in order to prevent downtime? Thanks..."
Yes, you will want to read their developers blog at: http://developers.facebook.com/blog

What does it mean for a Facebook Event to be "private"?

I use Facebook-C#-SDK 5.0.3 FacebookClient.Post("me/events", [parameters including "privacy" => "secret"]). The new event shows as "Private Event" on my Facebook. However, my friends see the event appear on their Wall, and when they click on the event they see it as "Public Event".
I am trying to create test events for debugging purposes, but even though I see the event as "Private Event", and when I edit the event the three checkboxes are cleared:
-- Anyone can view and RSVP (public event)
-- Guests can invite Friends
-- Show the guest list on the event page
the event is still visible and announced to all my friends. They can't RSVP, but they do get the UX to post to the event's wall.
Thanks,
Jon
With the SDK the convention is to pass parameters in as a dynamic object or dictionary.
According to a post here the parameter name for setting visibility is 'privacy_type'.
So (without testing) this is how I would go about it in .Net 4:
dynamic parameters = new ExpandoObject();
parameters.privacy_type = "SECRET";
_facebookClient.Post("me/events", parameters);

Trying to update a Facebook event using the Graph API (Facebook C# SDK)

I am trying to update the description of a Facebook event using the Facebook C# SDK. I have granted the following permission to my application:
'publish_stream,email,manage_pages,user_events,create_event,rsvp_event'
The event I am trying to update is one of my own events, so I believe I should be able to update it.
In the code below "9999" is the event id of the event I created, and the event I am trying to amend:
Authorizer authorizer = new Authorizer();
FacebookClient fbapp = new FacebookClient(authorizer.Session.AccessToken);
Console.Write(fbapp.Get("9999"));
dynamic parameters = new ExpandoObject();
parameters.description = "the new description";
fbapp.Post("9999", parameters);
The fbapp.Get works fine and returns the details of the event.
The problem is with the Post method, this returns (OAuthException) (#200) Permissions error
Any ideas as to where I am going wrong?
This issue is in fact a bug in the Facebook Graph API, see here for the bug report
It appears to be the case that you can only use the Graph API to edit events created by your app, and not existing events created by users within Facebook.
Hopefully it will be fixed soon!
If you really have all permissions, I think you should include every mandatory field in the parameters (as I haven't done this, I can only guess!) and not only the field you wish to edit.
Hope this has helped you Andrew.