Twitter Sample Code

Hello Corona Team,

I have just had a look at the sample code for twitter i.e.
http://developer.anscamobile.com/content/twitter

This does not work at all. I downloaded the app and installed it on my iPhone 4. I then put in totally random user details and a password and click send tweet and it still tells me that the tweet has been sent. This is not good at all. I have been struggling for the past two days with the Facebook connect app and now moved unto twitter and a sample app that you guys have up is not even working.

Help someone.

[import]uid: 37267 topic_id: 25879 reply_id: 325879[/import]

Have you tried the sample twitter app that is shipped with Corona? The recent Daily Builds has a working Twitter sample. Our previous sample (shipped with build 704) doesn’t handle Oauth but the new sample does.

Tom [import]uid: 7559 topic_id: 25879 reply_id: 104691[/import]

Yes, I just tried the sample app shipped with Corona.
Within the Twitter.lua file I put in my consumer key and consumer secret generated from the twitter website and this is the only change which I make.

On saving and pressing the Tweet button it tells me Failed: Invalid Token, building and running the sample app on my iPhone and iPad with the details above do not make any difference whatsoever.

I am at a loss over what I am omitting. [import]uid: 37267 topic_id: 25879 reply_id: 104873[/import]

Got it working now. I had to set the callback url in twitter and match it in the app i.e. twitter.lua
Nice times. [import]uid: 37267 topic_id: 25879 reply_id: 104893[/import]

Hello,
I am in the process of integrating “social” feature like Twitter and I am having couple issues and questions:

1- Where can I find the module Twitter.lua? I have build 790 and the folder does not have that module? When I try the example it simply crash because Twitter.lua is not present? Is this just a problem with thibuild 790?

2- I have a twitter account but i am afraid I am new to this. Where do i get my app key?

Thank you for any pointers guys.

Mo [import]uid: 100814 topic_id: 25879 reply_id: 107592[/import]

Ok, I downloaded the very latest build (818) and try running the twitter sample. Still no luck and still the same missing module (Twitter.lua)?? As I said, I tried it also with build 790 and the same crash happens on start. I can see the image on the screen for a second and then I get the following error:

[lua]Windows simulator build date: May 18 2012 @ 02:58:42
Copyright © 2009-2012 A n s c a , I n c .
Version: 2.0.0
Build: 2012.818
Runtime error
module ‘Twitter’ not found:resource (Twitter.lu) does not exist in archive
no field package.preload[‘Twitter’]
no file ‘c:\program files\ansca\corona sdk\sample code\networking\twitter\Twitter.lua’
no file 'C:\Program Files\Ansca\Corona Runtime error: module ‘Twitter’ not found:resource (T
witter.lu) does not exist in archive
no field package.preload[‘Twitter’]
no file ‘c:\program files\ansca\corona sdk\sample code\networking\twitter\Twitter.lua’
no file 'C:\Program Files\Ansca\Corona SDK\Resources\T[/lua]

Where can i get this Twitter.lua module? Do i need that module? OR is this Twitter module on the server side? For instance I can see the line in main.lua:

local TwitterManager = require( “Twitter” )

I am sure I am doing something wrong but would love to know what?
Thanks for any pointers.

Mo

ps: I am trying it on the simulator. Do I need to build the Twitter sample on the real device? That’s my next step… [import]uid: 100814 topic_id: 25879 reply_id: 107626[/import]

Hey, Mo @LairdGames, it sounds like something went wrong with your SampleCode folder. You might want to delete CoronaSDK, download 818 one more time and reinstall? I downloaded 818 yesterday, and out of curiosity, I looked at the SampleCode > Networking > Twitter just now, and Twitter.lua is there.

Running it on Simulator does not give me the error you posted.

Naomi [import]uid: 67217 topic_id: 25879 reply_id: 107668[/import]

Naomi. You are the best! I will do it again and see. The strange thing it was the same thing when I was running build 790? I may need to delete the build first before installing the new build. So far I am just installing over.

In any event thank you so much for your confirmation. That really help to know that Twitter.lua should be there. I started to believe that maybe it was server side now ( like say Jason.lua. I believe)

Do you know by any chance how to get an app I’d and key for Twitter so I can use this twitter sample app? Also curious if you are using this type of code or you simply use the web pop code that I saw somewhere around? Is that way still even valid?

As you can see I am just starting integrating social in my game and I am basically clueless right now:). Can’t wait to attack Facebook! Still I happy to have integrated email ( both for app support) and for sending score/app icon without a once of problem. I affraid Twitter and Facebook will not be a walk in the park like email integration was…

THANK YOU! [import]uid: 100814 topic_id: 25879 reply_id: 107671[/import]

@Naomi. I got the twitter app to work on my my mac. As you said the twitter.lua was there and that was build 790. Not sure why it did not work on my pc but I probably need to delete the build and try again.

On the Mac, the sample took me directly to the place when i can get my app id for twitter so I am cool on that. Not sure yet what to put on the callback bode I will try to search the forum for that.

Thanks again!

Mo [import]uid: 100814 topic_id: 25879 reply_id: 107681[/import]

Hey, Mo @LairdGames, glad to hear it. I haven’t integrated Twitter yet, so I’ll need to follow your step when I do. Good luck with your effort!

Naomi [import]uid: 67217 topic_id: 25879 reply_id: 107699[/import]

@Naomi. Absolutely, I will update the forum when I get it working. That the least I can do for this amazing community (which includes you!)

Cheers.

Mo [import]uid: 100814 topic_id: 25879 reply_id: 107714[/import]