Hi,
Trying to work this new twitter API 1.1 on Android device which is very frustrating and I am very close to banging my head against a wall.
Hoping if someone could help me in this regard.
Below is my problem:
I am trying to post status with image (screen captured and saved in system.DocumentDirectory). Everything seems to go fine (authentication/accessToken etc) except the final stage @ rawPostMultipartRequest function in oAuth.lua where I am getting this weird error:
"I/Corona (14207): RESPONSE: 403 nil 1 value expected at line 1**, column 1"**
Dont know what exactly is going wrong. Or what can I do to fix this.
Here’re my modified oAuth.lua Twitter.lua and multipartForm.lua files:
https://bitbucket.org/ali_nahid/androidtwitter/src
And this is how I am trying to do twitter post:
[lua]
local function AndroidTwitterButtonClicked( event )
native.setActivityIndicator( true );
print(“AndroidTwitterButtonClicked”);
TwitterManager = require( “Twitter” );
local imageName = “awesomeapp”;
imageName = imageName … “.jpg”;
local path = system.pathForFile( imageName, system.DocumentsDirectory );
print(path);
local picTaken = io.open( path );
if not picTaken then
print(“screenCap”);
local screenCap = display.captureScreen(false);
display.save( screenCap, imageName, system.DocumentsDirectory );
screenCap:removeSelf();
end
local msg = “MyAwesomeApp is an awesome app.”;
local params = {“tweet”, “statuses/update_with_media.json”, “POST”, {“status”,msg} };
TwitterManager.tweet(callback, params, imageName);
end
[/lua]
FYI: Tweeting just status seemed to work fine. It’s just when I attach a image to it (multipart data), it throws the above error.
No issues with iPhone. I have used native.showPopup( “twitter”, options ); for iOS and it works like a charm (even with attached image).
All the issues are on Android system (I have tested on both Android 2.2 and Android 4.0).
Can someone please review it and help me finding out the solution.
[Thanks in advance for your help]