Skip to content

Update FB graph API to v18.0 #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Add create_time and update_time to returned storage engine writes acks.
- Add storage index create flag to read only from the index.
- Add caller id param to storage listing and storage index listing runtime APIs.
- Update Facebook Graph API usage from v11 to v18.

### Fixed
- Fix linter-found test issue.
Expand Down
4 changes: 2 additions & 2 deletions social/social.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func NewClient(logger *zap.Logger, timeout time.Duration, googleCnf *oauth2.Conf
func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error) {
c.logger.Debug("Getting Facebook profile", zap.String("token", accessToken))

path := "https://graph.facebook.com/v11.0/me?access_token=" + url.QueryEscape(accessToken) +
path := "https://graph.facebook.com/v18.0/me?access_token=" + url.QueryEscape(accessToken) +
"&fields=" + url.QueryEscape("id,name,email,picture")
var profile FacebookProfile
err := c.request(ctx, "facebook profile", path, nil, &profile)
Expand All @@ -254,7 +254,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]
after := ""
for {
// In FB Graph API 2.0+ this only returns friends that also use the same app.
path := "https://graph.facebook.com/v11.0/me/friends?access_token=" + url.QueryEscape(accessToken)
path := "https://graph.facebook.com/v18.0/me/friends?access_token=" + url.QueryEscape(accessToken)
if after != "" {
path += "&after=" + after
}
Expand Down