hi, i m having a problem to send a tweet from my app. i get the request token fine, then the calback is redirecting me the specified url, and the tweet is not send,
in my controller i would like to do so:
// this brings me the request_token
$getrequestToken = new twiterManager();
$requestToken = $getrequestToken->getRequestToken();
$consumerKey = 'xxxx';
$consumerSecret = 'xxxx';
$OAuthToken = $_SESSION['oauth_token'];
$OAuthSecret = $_SESSION['oauth_token_secret'];
// create new instance
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $OAuthToken, $OAuthSecret);
// Your Message
$message = "This is a test message.";
my function looks like this:
// The TwitterOAuth instance
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
// Requesting authentication tokens, the parameter is the URL we will be redirected to/ apres avoir saisis log/pwd on consult le twitter_oauth.php
$urlRedi = OAUTH_CALLBACK;
$request_token = $twitteroauth->getRequestToken($urlRedi);
$_SESSION[‘oauth_token’] = $request_token[‘oauth_token’];
$_SESSION[‘oauth_token_secret’] = $request_token[‘oauth_token_secret’];
if($twitteroauth->http_code==200){
// Let's generate the URL and redirect
$url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
header('Location: '. $url);
}
when click on tweet (the boutton a have created related to the controller) i m redirected to the Authorization page, then i accept, and been redirected to the callback url but the The tweet is never sent.
So when should i call the function Post to send my tweet ?
thank you for helping me!