Twitter on Android - can't make GGTwitter work

I am using this code:

local listener = function( event ) if event.phase == "authorised" then twitter:post( descr ) print("twitter!") else native.showAlert(ERROR, event.phase , {OK}) end end twitter = GGTwitter:new( "xxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", listener ) twitter:authorise()

The listener gets triggered but unfortunately the phase is not “authorised”.

Instead the native alert displays “Failed”.

I have created the game on twitter developer and entered the right key and secret in the above code.

Anyone managed this to work on Android?

What am I missing?

Thank you for your help!

Before you run too far down this road, be warned that this hasn’t been updated in quite some time, and due to changes in Twitter’s API (I believe the change to 1.1) broke picture attachments for GGtwitter. I was trying to get it working back in September, to no avail. 

Hi Alex, than you for your reply.

Actually, it works. Not sure why, but suddenly the web page for twitter authorization opens (maybe it takes some time after setting the app on twitter) or it is because I entered a callback url.

Anyway, the message presented to the user is scary, which user will allow this:

"This application will be able to:

* Read tweets from your timeline

* See who you follow, and follow new people

* Update your profile 

* Post tweets for you

* Access your direct messages

I have enabled the max. permissions (Read, Write and Access direct messages).

Maybe I can remove at least the last permission.

All I wanna do is post a tweet, not update users profile or follow new people!

So you’re able to post both text and images with GGTwitter? Very nice. I believe that you just need Read/Write for your needs.

Just to confirm : I installed GGTwitter in my app, and it works fine on Android.

Before you run too far down this road, be warned that this hasn’t been updated in quite some time, and due to changes in Twitter’s API (I believe the change to 1.1) broke picture attachments for GGtwitter. I was trying to get it working back in September, to no avail. 

Hi Alex, than you for your reply.

Actually, it works. Not sure why, but suddenly the web page for twitter authorization opens (maybe it takes some time after setting the app on twitter) or it is because I entered a callback url.

Anyway, the message presented to the user is scary, which user will allow this:

"This application will be able to:

* Read tweets from your timeline

* See who you follow, and follow new people

* Update your profile 

* Post tweets for you

* Access your direct messages

I have enabled the max. permissions (Read, Write and Access direct messages).

Maybe I can remove at least the last permission.

All I wanna do is post a tweet, not update users profile or follow new people!

So you’re able to post both text and images with GGTwitter? Very nice. I believe that you just need Read/Write for your needs.

Just to confirm : I installed GGTwitter in my app, and it works fine on Android.

getting this error:

File: oAuth.lua Line: 205 Attempt to index local 'str' (a nil value) stack traceback: &nbsp; &nbsp;oAuth.lua:205: in function 'encode\_parameter' &nbsp; &nbsp;oAuth.lua:170: in function 'oAuthSign' &nbsp; &nbsp;oAuth.lua:41: in function 'getRequestToken' &nbsp; &nbsp;GGTwitter.lua:247: in function 'authorise' &nbsp; &nbsp;start.lua:527: in function \<start.lua:492\> &nbsp; &nbsp;?: in function \<?:221\>

I don’t know how committed you are to ggtwitter, but since this is a 3rd party solution we can’t really help and you would need to get in contact with Graham for support.

However, there is a new twitter plugin in the Plugin store made by Jason Schroeder. He has to support it, but its well documented. I recommend you check it out if you can’t get help from Graham.

Rob

Hi Rob im just playing around with different options, ps i am using Jason’s plugin. but its missing the picture upload function 

@mmk.verheijeden,

I did put in a request to Jason a week or so ago for the picture upload function and I believe he has added it to his wishlist. I know he is pretty busy with client work at the moment but hopefully it will be added once he gets some free time, .

Maybe if he sees this thread he may well add a comment.

Hi MMK, as Anil indicated I do have a “punch list” of feature requests for the plugin but I’m a bit swamped between my dayjob and 2 client app projects at the moment so making and QA testing plugin updates is unfortunately on my back burner for now.

However, easy image uploading vis the plugin is on the roadmap. It’s worth noting that you should be able todo this already by using twitter.request - but you’ll have to handle all the multipart form encoding, etc, yourself. It’s a bit tricky. But when I add support to the plugin, I’ll try to make it as simple as passing in an image file or Corona display object.

getting this error:

File: oAuth.lua Line: 205 Attempt to index local 'str' (a nil value) stack traceback: &nbsp; &nbsp;oAuth.lua:205: in function 'encode\_parameter' &nbsp; &nbsp;oAuth.lua:170: in function 'oAuthSign' &nbsp; &nbsp;oAuth.lua:41: in function 'getRequestToken' &nbsp; &nbsp;GGTwitter.lua:247: in function 'authorise' &nbsp; &nbsp;start.lua:527: in function \<start.lua:492\> &nbsp; &nbsp;?: in function \<?:221\>

I don’t know how committed you are to ggtwitter, but since this is a 3rd party solution we can’t really help and you would need to get in contact with Graham for support.

However, there is a new twitter plugin in the Plugin store made by Jason Schroeder. He has to support it, but its well documented. I recommend you check it out if you can’t get help from Graham.

Rob

Hi Rob im just playing around with different options, ps i am using Jason’s plugin. but its missing the picture upload function 

@mmk.verheijeden,

I did put in a request to Jason a week or so ago for the picture upload function and I believe he has added it to his wishlist. I know he is pretty busy with client work at the moment but hopefully it will be added once he gets some free time, .

Maybe if he sees this thread he may well add a comment.

Hi MMK, as Anil indicated I do have a “punch list” of feature requests for the plugin but I’m a bit swamped between my dayjob and 2 client app projects at the moment so making and QA testing plugin updates is unfortunately on my back burner for now.

However, easy image uploading vis the plugin is on the roadmap. It’s worth noting that you should be able todo this already by using twitter.request - but you’ll have to handle all the multipart form encoding, etc, yourself. It’s a bit tricky. But when I add support to the plugin, I’ll try to make it as simple as passing in an image file or Corona display object.