summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÁlvaro Peña <alvaropg@gmail.com>2017-10-03 15:24:52 +0200
committerÁlvaro Peña <alvaropg@gmail.com>2017-10-24 00:17:59 +0200
commit21bca81288dac5ec378b21773fff949fb093ca0d (patch)
tree66296e3fe2d6dcc4971721ed4e9e19b3205bce7e
parentbc03c1f8fa59d80b9a12c0a57c26e7a2f852651e (diff)
downloadlibgfbgraph-21bca81288dac5ec378b21773fff949fb093ca0d.tar.gz
Graph: Updated to Graph API v.2.10
Updated endpoint URL to the new Graph version. It was required to use the "fields" param (see https://developers.facebook.com/docs/graph-api/using-graph-api#reading) to retrieve the email of an user and added the permission "email" too. https://bugzilla.gnome.org/show_bug.cgi?id=772243
-rw-r--r--gfbgraph/gfbgraph-common.c2
-rw-r--r--gfbgraph/gfbgraph-user.c1
-rw-r--r--tests/gtestutils.c14
3 files changed, 7 insertions, 10 deletions
diff --git a/gfbgraph/gfbgraph-common.c b/gfbgraph/gfbgraph-common.c
index 2da1ec4..137f880 100644
--- a/gfbgraph/gfbgraph-common.c
+++ b/gfbgraph/gfbgraph-common.c
@@ -21,7 +21,7 @@
#include <rest/rest-proxy.h>
-#define FACEBOOK_ENDPOINT "https://graph.facebook.com/v2.3"
+#define FACEBOOK_ENDPOINT "https://graph.facebook.com/v2.10"
/**
* gfbgraph_new_rest_call:
diff --git a/gfbgraph/gfbgraph-user.c b/gfbgraph/gfbgraph-user.c
index 7af2fc1..34410b3 100644
--- a/gfbgraph/gfbgraph-user.c
+++ b/gfbgraph/gfbgraph-user.c
@@ -265,6 +265,7 @@ gfbgraph_user_get_me (GFBGraphAuthorizer *authorizer, GError **error)
rest_call = gfbgraph_new_rest_call (authorizer);
rest_proxy_call_set_function (rest_call, ME_FUNCTION);
rest_proxy_call_set_method (rest_call, "GET");
+ rest_proxy_call_add_param (rest_call, "fields", "name,email");
result = rest_proxy_call_sync (rest_call, error);
if (result) {
diff --git a/tests/gtestutils.c b/tests/gtestutils.c
index 3006bc0..af76870 100644
--- a/tests/gtestutils.c
+++ b/tests/gtestutils.c
@@ -44,9 +44,9 @@ struct _GFBGraphTestApp
gchar *access_token;
};
-#define FACEBOOK_ENDPOINT "https://graph.facebook.com/v2.3"
+#define FACEBOOK_ENDPOINT "https://graph.facebook.com/v2.10"
-#define FACEBOOK_TEST_USER_PERMISSIONS "user_about_me,user_photos,email,publish_actions"
+#define FACEBOOK_TEST_USER_PERMISSIONS "email,user_about_me,user_photos,publish_actions"
GFBGraphTestApp*
gfbgraph_test_app_setup (void)
@@ -174,15 +174,12 @@ gfbgraph_test_fixture_setup (GFBGraphTestFixture *fixture, gconstpointer user_da
}
static void
-gfbgraph_test_fixture_teardown (GFBGraphTestFixture *fixture, gconstpointer user_data)
+gfbgraph_test_fixture_teardown (GFBGraphTestFixture *fixture, __attribute__ ((unused)) gconstpointer user_data)
{
SoupSession *ssession;
SoupMessage *smessage;
gchar *function_path;
- gchar *auth_value;
guint status;
- const GFBGraphTestApp *app = user_data;
- SoupURI *uri;
/* Delete the test user and clean up memory */
@@ -196,14 +193,13 @@ gfbgraph_test_fixture_teardown (GFBGraphTestFixture *fixture, gconstpointer user
g_assert_cmpint(status, ==, 200);
g_free (function_path);
- g_free (auth_value);
g_free (fixture->user_id);
g_free (fixture->user_email);
g_object_unref (fixture->authorizer);
}
static void
-gfbgraph_test_me (GFBGraphTestFixture *fixture, gconstpointer user_data)
+gfbgraph_test_me (GFBGraphTestFixture *fixture, __attribute__ ((unused)) gconstpointer user_data)
{
GFBGraphUser *me;
GError *error = NULL;
@@ -220,7 +216,7 @@ gfbgraph_test_me (GFBGraphTestFixture *fixture, gconstpointer user_data)
}
static void
-gfbgraph_test_album (GFBGraphTestFixture *fixture, gconstpointer user_data)
+gfbgraph_test_album (GFBGraphTestFixture *fixture, __attribute__ ((unused)) gconstpointer user_data)
{
GFBGraphUser *me;
GFBGraphAlbum *album;