Problem posting image to Twitter

Yep, I was saying earlier how the Twitter app was working fine, but GGTwitter and other third party options (Tweetcaster through the sharing panel) were still swinging in the breeze.

I’ll make do with what is working for now. Gotta make a dollar out of fifteen cents these days…

Hmmm…

Using the latest daily build (2288) on a Samsung Galaxy Tab 2 I only get the text in the tweet and not the image. Regardless of whether I use .jpg or .png or system.CachesDirectory or system.DocumentsDirectory.

I use the official Twitter app.

Any ideas?

local options = { service = "twitter", message = "message", url = {urlLink}, image = { baseDir = system.CachesDirectory, filename = "Completed.jpg", }, --listener = TweetCallback, } display.save(display.getCurrentStage(), "Completed.jpg", system.CachesDirectory) native.showPopup("social", options)

Have you tried to put a small delay on showing the popup? Maybe the file needs some time to become available?

I can give it a go tomorrow if you have no luck.

Alas no luck inserting a delay - even 5 seconds delay.

I don’t know if this is an Android fragmentation thing or what. I’m definitely stuck now. Help! :slight_smile:

Best - MAS1

@MAS1
 
It looks like you’re missing an extra { } for image.
The image parameter should be a table of tables. My code looks like this:

native.showPopup(popupName, { service = serviceName, message = msg, image = {{baseDir=system.TemporaryDirectory, filename="chameleon\_ss.jpg"}}, listener = listener, });

The reason for this is so that you can attach more than 1 image.

@ingemar,

Wow! You were right. Once again the docs have tripped me up :frowning:

According to this: http://coronalabs.com/blog/2013/08/06/introducing-the-social-plugin-ios/

image  — a table containing sub-tables

According to this: http://docs.coronalabs.com/api/library/native/showPopup.html

  • options.image is a table of the form { baseDir=, filename= } to the image you wish to post.

Hours wasted! Still - I’m extremely grateful for your help with it. Now, I wonder how easy/difficult it is to post images to Facebook with Android? I’m already worried…

Thanks again - MAS1

During my testing I had no issues posting images to either Twitter (iOS/Android) or Facebook (iOS).

Facebook isn’t an option on Android when using the ‘social’ plugin. This isn’t anything CoronaLabs can do anything about since it’s a problem on Facebook’s end and the Facebook team are not planning to fix it. (https://developers.facebook.com/bugs/332619626816423)

@ingemar,

Yes indeed - iOS works great for posting to Facebook or Twitter - even without the extra {} when posting one image which is what I do on iOS. Of course, the extra {} are necessary on Android - and again, thanks for pointing that out!

I’ll have a look at the Corona sample for Facebook and/or GGFacebook from Glitch Games and see if that works/suits.

Thanks again!

MAS1

@ingemar

Sadly this code now no longer works. Bizzare!

local options = { service = "twitter", message = "message", url = {urlLink}, image = { {baseDir = system.CachesDirectory, filename = "image.png"} }, } display.save(display.getCurrentStage(), "image.jpg", system.CachesDirectory) native.showPopup("social", options) 

Regardless of whether I use system.CachesDirectory, system.DocumentsDirectory or system.TemporaryDirectory

Inserting a delay of 1.5 seconds before the call to native.showPopup() make no difference either. Is your image sharing for Twitter still working?

Same buid (2288) same device Samsung Galaxy Tab 2 (4.2.2). I even tried deleting the standard Twitter app and re-installing. No luck.

Help!

MAS1

Huh! No it doesn’t work for me either. (latest daily build)
Something must’ve broke the Twitter image posting for android. ios is fine…

It’s a bit over 2:20am here now, but I’ll look into this first thing tomorrow morning.

OK…

I tested this with an app that was released a month ago on the Google Play Store. It was working then, but now the image is not attached to the Twitter post.

I see that the Twitter app was updated on May 19th, 2014 and I suspect that some breaking change was introduced, at least regarding Corona’s Social plugin.

The strange thing is that the Share dialog for the built-in Photos app can attach images with the new Twitter version. The sharing dialog looks different though, so maybe Corona is calling some different method… I don’t know.

iOS is not affected at all. It works as expected even though the Twitter app was updated on May 13th.

I’m going to file a bug report.

@ingemar - I appreciate you filing that bug report. My live app that did work successfully now no longer attaches images - ouch!  :frowning: .

@Corona - Please make this a high priority fix. It’s a show stopper for those of use integrating social media into Android. 

Best wishes,

MAS1.

Same here. My live app isn’t able to attach images to Twitter anymore either.

I was also going to push an update to some apps, but I will have to wait for this to be fixed before I do.

Hopefully it’s something CoronaLabs can do something about…

Reported as case 32972

I’ve got 30+ apps to move over from iOS to Android. Now they are all on hold.

The bigger picture is that this could break again in the future and we don’t know about the break soon enough. You’d think once something is tested and shipped it’d be unbreakable! That’s mobile for you.

It’s now 07:55 here in the UK!

Best wishes - MAS1

From what I can see this breakage is caused by the new Twitter app that was released on May 19.

I’m trying to see if I can get hold of an old version of the Twitter app and see if that is in fact the culprit.

@ingemar

What a great sleuth you are! I’ve encountered you on these forums before. If Corona don’t offer you a job at some point given the work you do on these forums then I’ll be amazed!

Good luck with your apps!

MAS1.

It’s confirmed!  

I downloaded an old version of Twitter (5.3.0) that was released April 1, 2014 which was the current version when I released my live app. It works perfectly, even with the test project I submitted in my bug report.

The current version of Twitter is 5.10.0, so something has changed in the way that it accepts image attachments.

The strange thing is that the builtin Android Photo app can attach images to Twitter without problems, so it must attach images in a different way than Corona does.

Excellent spot Ingemar!

I wonder how long this will take to fix? Hopefully days and not weeks…

MAS1

I am on my journey of social media integration and this is throwing a big ol’ wrench into it. Hopefully we’ll get a fix soon.

Issues with Facebook, Twitter, social plugins… this is why I stay in my basement and don’t talk to anyone. I will, however, come out when this gets fixed…

1098.gif

@Panc software,

Hilarious - love the humor!

+1 This needs fixing ASAP!  :smiley: