Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nakama
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public-projects
Nakama
Commits
dd51571d
Commit
dd51571d
authored
4 years ago
by
Andrei Mihu
Browse files
Options
Downloads
Patches
Plain Diff
Update to Facebook Graph API v9.0, remove unused Facebook profile request fields.
parent
f32e880b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
social/social.go
+6
-9
6 additions, 9 deletions
social/social.go
with
8 additions
and
9 deletions
CHANGELOG.md
+
2
−
0
View file @
dd51571d
...
@@ -8,6 +8,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
...
@@ -8,6 +8,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
-
Make metrics prefix configurable, default to fixed value.
-
Make metrics prefix configurable, default to fixed value.
-
Build with Go 1.15.5 release.
-
Build with Go 1.15.5 release.
-
Skip logging Lua errors raised by explicit runtime calls to the
`error({msg, code})`
built-in.
-
Skip logging Lua errors raised by explicit runtime calls to the
`error({msg, code})`
built-in.
-
Update to Facebook Graph API v9.0.
-
Facebook authentication no longer requires access to gender, locale, and timezone data.
### Fixed
### Fixed
-
Better handling of SSL connections in development configurations.
-
Better handling of SSL connections in development configurations.
...
...
This diff is collapsed.
Click to expand it.
social/social.go
+
6
−
9
View file @
dd51571d
...
@@ -81,9 +81,6 @@ type FacebookProfile struct {
...
@@ -81,9 +81,6 @@ type FacebookProfile struct {
ID
string
`json:"id"`
ID
string
`json:"id"`
Name
string
`json:"name"`
Name
string
`json:"name"`
Email
string
`json:"email"`
Email
string
`json:"email"`
Gender
string
`json:"gender"`
Locale
string
`json:"locale"`
Timezone
float64
`json:"timezone"`
}
}
type
facebookPagingCursors
struct
{
type
facebookPagingCursors
struct
{
...
@@ -194,8 +191,8 @@ dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE=
...
@@ -194,8 +191,8 @@ dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE=
func
(
c
*
Client
)
GetFacebookProfile
(
ctx
context
.
Context
,
accessToken
string
)
(
*
FacebookProfile
,
error
)
{
func
(
c
*
Client
)
GetFacebookProfile
(
ctx
context
.
Context
,
accessToken
string
)
(
*
FacebookProfile
,
error
)
{
c
.
logger
.
Debug
(
"Getting Facebook profile"
,
zap
.
String
(
"token"
,
accessToken
))
c
.
logger
.
Debug
(
"Getting Facebook profile"
,
zap
.
String
(
"token"
,
accessToken
))
path
:=
"https://graph.facebook.com/v
5
.0/me?access_token="
+
url
.
QueryEscape
(
accessToken
)
+
path
:=
"https://graph.facebook.com/v
9
.0/me?access_token="
+
url
.
QueryEscape
(
accessToken
)
+
"&fields="
+
url
.
QueryEscape
(
"name,email
,gender,locale,timezone
"
)
"&fields="
+
url
.
QueryEscape
(
"name,email"
)
var
profile
FacebookProfile
var
profile
FacebookProfile
err
:=
c
.
request
(
ctx
,
"facebook profile"
,
path
,
nil
,
&
profile
)
err
:=
c
.
request
(
ctx
,
"facebook profile"
,
path
,
nil
,
&
profile
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -213,7 +210,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]
...
@@ -213,7 +210,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]
after
:=
""
after
:=
""
for
{
for
{
// In FB Graph API 2.0+ this only returns friends that also use the same app.
// In FB Graph API 2.0+ this only returns friends that also use the same app.
path
:=
"https://graph.facebook.com/v
5
.0/me/friends?access_token="
+
url
.
QueryEscape
(
accessToken
)
path
:=
"https://graph.facebook.com/v
9
.0/me/friends?access_token="
+
url
.
QueryEscape
(
accessToken
)
if
after
!=
""
{
if
after
!=
""
{
path
+=
"&after="
+
after
path
+=
"&after="
+
after
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment