Conversation
…ture/default-fields
|
What do you say? 🙄 |
Charca
left a comment
There was a problem hiding this comment.
Hey @drezo, thanks for the PR and sorry for the big delay. I haven't been paying much attention to this project or the chatbot scene for the last year, I apologize if this makes your job harder.
The PR looks good for the most part, I left a couple of comments for thing that I'd like to see changed. Please let me know what you think.
| */ | ||
| getUserProfile(userId) { | ||
| const url = `https://graph.facebook.com/${this.graphApiVersion}/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken}`; | ||
| getUserProfile(userId, fields) { |
There was a problem hiding this comment.
Can we give fields a default value of []? Otherwise, the check on line 344 would make the method fail for people who are calling it directly without fields.
|
|
||
| | Param | Type | Default | Required | | ||
| |:------|:-----|:--------|:---------| | ||
| | `fields` | array | ['id', 'name', 'first_name', 'last_name', 'profile_pic'] | `N` | |
There was a problem hiding this comment.
It seems that we should change this description. The default value of the fields param is not ['id', 'name', ... ], it's an empty array. When you specify fields, you're not overwriting this default value, you're extending it. I think we should either change the behavior to allow specifying/overwriting all fields, or change this description and maybe the param name to extraFields so that it's clear that you're extending the default. What do you think?
Hello! ✌️
Permissions my application ("locale", "timezone", "gender" unavailable):
Next, we downloaded current version package (1.0.16), used method "getUserProfile()" and get the follow error 😑:
{ "error":{ "message":"(#100) Insufficient permission to access user profile.", "type":"OAuthException", "code":100, "error_subcode":2018247, "fbtrace_id":"CZW1EcCa704" } }Changed method "getUserProfile()":
Thanks!