Unverified Commit b6ecd095 authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Update FB graph API to v18.0 (#1102)

parent 2396870a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,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
- Fixed multiple issues found by linter.
+2 −2
Original line number Diff line number Diff line
@@ -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)
@@ -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
		}