AkaiKitsune
|
Posted: December 29, 2011 07:49 by AkaiKitsune
|
|
Hi, Right now i am developing an application for blackberry that can tweet on twitter whenever user updated status in the apps. I used the sample given in TwitterAPIME-RIM-OAuthSample.zip file and it worked flawlessly in the simulator. But when i imported it to device. It failed to authorize. This is my code :
public void onAuthorize(Token token) {
_htable.put("TokenKey", token.getToken());
_htable.put("TokenSecret", token.getSecret());
persist.forceCommit();
Credential c = new Credential(CONSUMER_KEY, CONSUMER_SECRET, token);
UserAccountManager uam = UserAccountManager.getInstance(c);
//
try {
if (uam.verifyCredential()) {
UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
System.out.println("Tweet posted!");
}
else {
Dialog.alert("Verify failed");
UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
}
} catch (Exception e) {
System.out.println("Error by posting tweet.");
}
}
In the simulator, it worked. I can take the token key and then use it to post on twitter. But on the device ( I am using Blackberry 9810 OS 7.0 ), it failed to execute anything below onauthorized(token token), even to get the key and store it. Whenever i tried to take the key, it returned null. Does anyone know how to solve this? I am stuck. Thank you in advance. |
Twitter api me 1.8 for Blackberry not working on device
Replies: 10 - Last Post: May 09, 2012 15:02
by: sandra13
by: sandra13
showing 1 - 11 of 11
Ernandes Mourao Junior
|
Posted: January 02, 2012 12:13 by Ernandes Mourao Junior
|
| onauthorized() is being called and the passed token is null? |
AkaiKitsune
|
Posted: January 03, 2012 02:07 by AkaiKitsune
|
|
Thank you for the reply^^ Yes sir. It returned the url callback. So that means the onauthorized() method is working, right? But it's just that, then nothing working. No key stored, and the url callback didn't close itself. It's as if nothing i wrote on onauthorized() ever executed. What makes me confused even more is that it worked just fine in the simulator. This problem i spoken of only present in the device. |
Ernandes Mourao Junior
|
Posted: January 03, 2012 16:39 by Ernandes Mourao Junior
|
|
"Yes sir. It returned the url callback. So that means the onauthorized() method is working, right?" Not necessarily! If your your OAuthDialogListener object is registered as listener to your wrapper object and the url callback is displayed, then onAuthorize() must be called. But the strange thing is a null token. It is not supposed to happen. Actually, it is impossible!!! ![]() You have to close the screen that displays your url callback by yourself. Once onauthorized() is called and you grab your token, you are supposed to close it. |
AkaiKitsune
|
Posted: January 04, 2012 02:31 by AkaiKitsune
|
|
Thank you for the reply^^ I followed the instructions and it worked flawlessly on Blackberry 9800 which used OS6. The code i written above worked. It get the token and i can use it to post to twitter. Then i tried it on BB 9810 which used OS7, and i can't get the token anymore, and thus unable to post. Then i tried again with BB 9900 and the result is the same. I used the same code again at BB 9780 which used OS6 and it worked again. Same code, tested on four devices. It only works on devices with OS6. That's where i draw conclusion that something in OS7 is preventing the api to work like it should. I am still looking where's that 'something' is. |
Ernandes Mourao Junior
|
Posted: January 04, 2012 12:17 by Ernandes Mourao Junior
|
|
Great! So, please, keep digging! In case you find the problem, I can fix anything in the API, if it is the case. Thanks!!! Regards, |
AkaiKitsune
|
Posted: January 03, 2012 04:08 by AkaiKitsune
|
|
Ummm, there is one more thing, I tested it some more. And now i am certain that it doesn't work in Blackberry OS 7 when using Wifi Connection. I tested in Blackberry OS 6.0 and it worked. Thank you |
Ernandes Mourao Junior
|
Posted: January 03, 2012 16:40 by Ernandes Mourao Junior
|
| But it worked on BB OS 6 on device? Can identify why it does not on v7? |
ffgiraldez
|
Posted: January 30, 2012 09:23 by ffgiraldez
|
hi, i have the same problem , I was able to trace the code to the method
protected void loadUrl(final String url, final byte[] postData,final Event event) {}
and the last line was browserManager.setContent(conn, renderingListenerOAuth, event); i really don“t know why this issue but, i only can run the sample demo on OS6, no in OS5 or 7 i hope this can help |
timwelab
|
Posted: March 14, 2012 17:28 by timwelab
|
|
hi, i have the same problem. i've already tested the TwitterAPIME-RIM-OAuthSample and it works on OS6 but no on OS5 neither OS7. I used real devices OS5 - bb 8900 OS6 - bb torch OS7 - bb 9360 I need to use it with OS7 because i'm working in a NFC project. Can you help me with this issue. Thank You. |
sandra13
|
Posted: May 09, 2012 15:02 by sandra13
|
| Hello, I'm having the same problem. I'm using the 1.8 version and after logging in, I'm redirected to the callbackurl and then nothing happens. When I debug, onAuthorize is never called. It just redirects me to the callbackurl and stays there. Any help? |
showing 1 - 11 of 11
Replies: 10 - Last Post: May 09, 2012 15:02
by: sandra13
by: sandra13








