-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug between 0.7 and 0.8 #4
Comments
That's bad news. I'm looking into it. Can you tell me which platform and SDK version and what titanium version you are using? |
SDK titanium : 1.6.2 |
On iPhone 4.3 and Ti Mobile 1.2.2 I'm not experiencing issues. |
I use The Ti developper 1.2.2 too, but what is the version of the titanium mobile SDK? The last stable version is : 1.6.2 and developping version : 1.7.0 |
Oh, yea, sorry--I keep doing that. I'm using 1.6.2. Are you on iPhone or Android? |
I'm on iphone but on the simulator, I don't have the device. |
Ok, that's fine--I'm testing in simulator as well. I'm not experiencing this issue. Can you perhaps use the debug version and post your output? Be sure to remove tokens and such. |
[INFO] ----- Opening Tweet UI ----- |
!!!! |
Hmm... maybe not. Let me do a fresh build and see if I get any errors. |
Ok, I'm not exactly sure how to interpret what's happening. The last two lines of output are coming from line 548 in debug js. It looks like the error is "Authentication needed", but I don't understand that. Line 548 will only fire if the call fails to get a response from Twitter, so that authentication error can't come from Twitter. Are you behind a proxy or firewall or something that's blocking the call? What are your thoughts? |
I'm not behind a proxy. I test with 0.7 version, I don't have the error message, the winTW close but the tweet never arrive on twitter website. Always, if i kill the application, the tweet function work fine. Thx for your help and sorry for my english :-) |
what i'm doing is very simple : twitter.addEventListener('click',function(e){
}); the twitter object is a button create with Ti.UI.createButton |
Ok, sorry I couldn't be of more help. If anyone else is having this issue please keep us updated! Cheers! |
Hahaha, it looks like you commented before I did! I didn't see it. Ok, lunika, something to keep in mind. The API function has built in an authorization checker, see line 463 of the debug version. So, that code you posted could be condensed to: BH.tweet('Some default text.'); And it, conceptually, does the same thing. Will this suffice for you? Now, what you are trying to do IS supposed to work, so this really is a bug. I will put this in the works to be tested and fixed by v0.9. |
I change with you proposition, only : BH.tweet('Some default text.'); It does the same thing and the same error. this is the Json response of twitter : response: {"request":"/1/statuses/update.json?status=Some%2520default%2520text.","error":"Could not authenticate you."} |
Hmmm... I'm at a loss here. Can you verify that: (1) when you initialized BirdHouse you have the correct API keys like such: var BH = new BirdHouse({ consumer_key: "yourappsconsumerkey", consumer_secret: "yourappsconsumersecretwhichislonger", callback_url: "http://yourappscallbackurl.com"; }); and (2) that in your application's settings the application's type is "Browser" (not "Client") and the callback url is set? Also, can you post as much of the output as you can? |
(1) : I initialized BirdHouse like your exemple in the BirdHouseApp with the right parameters (2) I send the output later |
Yes, but here's the thing: response: {"request":"/1/statuses/update.json?status=Some%2520default%2520text.","error":"Could not authenticate you."} Should be coming from a different context than: [INFO] var_dump: error (object):Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x6e07bf0 {NSLocalizedDescription=Authentication needed} [DEBUG] The API XHR request has failed! Status=4 and var_dump of e is undefined if indeed that response is coming from Twitter, because, as mentioned, the latter (the XHR request failed) is an error thrown by Titanium. Did I explain that correctly? So, I'm wanting to see the most recent output, the "Could not authenticate you." error, in context to help me understand what's going on, since I can't reproduce the error. |
Ok, lunika, just this week I had incorrectly typed the consumer keys and received errors that are what I think identical to yours: [INFO] var_dump: error (object):Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x6a377f0 {NSLocalizedDescription=Authentication needed} [DEBUG] The API XHR request has failed! Status=4 and var_dump of e is undefined [INFO] response: Failed to validate oauth signature and token Can you first double check and make sure your tokens are correct? Next, if that does not fix the issue, can you please give the full output for context to the error? |
My consumer_key et consumer_secret are good. I can send tweet but not after calling authorize function. This is what I do :
What information do you want? |
can I have your mail to send you all the output? |
lunika, I forgot you are in a different time zone. I followed exactly as you had done (I even tried other functions) and it worked. Yea, if you can authorize then your consumer tokens are certainly correct. It would help to have the output--my hope is to compare your output with mine to find what the issue is. My email is [email protected] and please remove/modify your consumer tokens from the output. I do hope we can find the issue. |
Hi guys, I'm also having problems. Titanium Studio RC1.0, Titanium SDK 1.6.2, iPhone 4 simulator. Basically I can use the tweet() method which displays the Twitter login page. I can log in and it briefly displays a PIN in a large font before the view closes. The alert message "Your tweet was not sent :(". This happens on your test app I just downloaded this afternoon. Output from my debug window shows the following: [DEBUG] fn-get_request_token: callback is undefined
[DEBUG] url is going to: http://api.twitter.com/oauth/authorize?oauth_token=XXXXXXXX
[INFO] 1:
[INFO] 2:
[INFO] 3: Twitter / Authorize an application
[INFO] 4: http://api.twitter.com/oauth/authorize?oauth_token=XXXXXXXX
[INFO] iAds have finished loading: load
[INFO] 1:
[INFO] 2: http://api.twitter.com/oauth/authorize?oauth_token=XXXXXXXX
[INFO] 3: Twitter / Authorize an application
[INFO] 4: https://api.twitter.com/oauth/authorize
[INFO] ============== loads 2 ==============
[INFO] ====================check status
[INFO] ----ACCESS DENIED!!!!----
[DEBUG] fn-tweet: after asking for authorization, we didn't authorize, so we can't send the tweet.
[INFO] CALLBACK 0-false My Twitter credentials are definitely correct because I get a message from Twitter briefly telling me that the app has been authorised and that the PIN gets displayed. Like I say, it doesn't work for me with the test app either. The code I used was in my app was: var BH = new BirdHouse({
consumer_key: "xxx",
consumer_secret: "xxxxxxxxxxxxxx",
show_login_toolbar: true
// ,callback_url: "http://yourappsEXACTcallbackurl.com"
});
var twitterAlertDialog = Ti.UI.createAlertDialog({
title: 'Message from Twitter',
buttonNames: ['OK']
});
// tweet content
var tweet = 'Test tweet';
BH.tweet(tweet, function(resp){
if (resp===true) {
twitterAlertDialog.message = 'Your tweet was sent successfully';
} else {
twitterAlertDialog.message = 'Your tweet could not be sent';
}
twitterAlertDialog.show();
}); Any ideas what could be going wrong? It seems to stumble at the final hurdle. Thanks in advance. |
@guavadesign, I see that the second URL does not have the auth token, which means when Twitter forwards on it does not see the token in the URL and the app thinks it failed: [INFO] 4: http://api.twitter.com/oauth/authorize?oauth_token=XXXXXXXX ... [INFO] 4: https://api.twitter.com/oauth/authorize In the latest version (0.9) I had hoped this kind of issue would be fixed by adding the setTimeout(checkStatus,1000) on line 243 on birdhouse.js. Perhaps set the timeout to 3000 and see if it catches the token. Currently, I do not have time to devote to looking into this, but when I get a chance to I will look into the get_request_verifier so that instead of looking in the url for the oauth_token as so: var parts = (e.url).replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { params = params + m; if (key=='oauth_verifier') { cfg.request_verifier = value; } }); It will look for the specified callback_url link. So, something like: if (webView.url==callback_url){ //look for keys in url //if none found then who knows what happened //if found go to next step (get auth tokens) } I'm sorry I can't be of more help. If anyone can implement either of these to avoid this issue please share! |
Can you see if this comment fixed anything: There is a supposed issue with the window? |
Getting the same issue on iOS here. Still investigating.... |
has anyone been able to fix this issue... |
can someone try changing http://api.twitter.com/1/statuses/update.json to https://api.twitter.com/1/statuses/update.json and see if that works... ? it did for me. |
I tried, but no improvement, Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x6955110 {NSLocalizedDescription=Authentication needed} [DEBUG] The API XHR request has failed! Status=4 Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x6955110 {NSLocalizedDescription=Authentication needed} and var_dump of e is undefined [INFO] Failed to send tweet. status=XXX [INFO] fn-tweet: retval is falseAny other solutions...? |
These are the steps that i followed and it is working fine for me now...
api(url, 'POST', 'oauth_token=' + cfg.request_token + '&oauth_verifier=' + cfg.request_verifier, function(ret, resp) { Let me know if there is anything i can do to help.. |
I have the same problem as here #4 (comment) . All that has been proposed as a solution - does not work. Any ideas? Windows7 Regards |
[INFO] var_dump: type (object):error [DEBUG] The API XHR request has failed! Status=4 and var_dump of e is undefined Does anybody know how to fix this issue. It started just recently (it was working fine before)! |
Crazily enough, the error happens with 1.8.0.1 and 1.8.1! It goes away with 1.7.5!!! Guys try 1.7.5 if you are having issues! |
For me with titanium SDK 2.0 and xcode 4.3 works changing http for https |
A bug is introducing in version 0.8 that is not present in 0.7
After calling authorize, you cannot send a tweet. If you kill the Application, you can send tweet.
The text was updated successfully, but these errors were encountered: