我将使用twitter 0auth登录,我的应用程序已列入白名单。现在我想访问客户端邮件id,但twitter不返回任何字段(电子邮件),所以收到此消息后,请建议我在应用程序列入白名单后进行任何其他更改然后
- 更新隐私策略
- 更新条款和条件
- 勾选电子邮件访问选项
- 重新生成应用程序安全密钥和id
- 重新生成应用程序令牌访问
授权时间(访问电子邮件)中也有一个选项
但没有收到电子邮件
我的代码部分是
$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);
unset($_SESSION['oauth_token']);
unset($_SESSION['oauth_token_secret']);
$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $access_token['oauth_token'], $access_token['oauth_token_secret']);
/* If method is set change API call made. Test is called by default. */
$content = $connection->get('account/verify_credentials',['include_email' => true]);
print_r($content);
通过OAuth授权后,您需要使用?include_email=true
选项集调用account/verify_credentials
端点。