reactnativecn / react-native-qq

308 stars 87 forks source link

如何获取用户昵称,头像等信息 #31

Closed litingjun2015 closed 7 years ago

litingjun2015 commented 7 years ago

您好:

QQAPI.login()
      .then((result)=>{
        console.log('QQAPI("get_simple_userinfo") result', result)
      })
      .catch((e)=>{
        console.error(e);
      })

QQAPI("get_simple_userinfo") result { access_token: '20DC93112C8D64EA8FFDFB98……',
  expires_in: 1484811033094.407,
  oauth_consumer_key: '1105771778',
  errCode: 0,
  openid: '831CADEDFC4106C3……' }

如果我想获取用户昵称,头像等信息,scopes参数应该如何填写?

谢谢。

LancCJ commented 7 years ago

解决了么?今天用也发现找不到 用户信息

rox0008 commented 7 years ago

同问啊。只有一个 get_simple_userinfo ,那其他的呢

jimtang9527 commented 7 years ago

另外接口获得头像昵称等信息

QQAPI.login('all').then((data) => {
                let url = 'https://graph.qq.com/user/get_user_info?access_token=' + data.access_token + '&oauth_consumer_key=' + data.oauth_consumer_key + '&openid=' + data.openid
                console.log({ data, url })
            })
litingjun2015 commented 7 years ago

@jimtang9527 可以了,谢谢你的信息!