Skip navigation
Currently Being Moderated

Sending Tweets via Adobe AIR iOS Apps

Jun 19, 2012 8:44 AM

Tags: #air #script #3.0 #action #3 #actionscript #as3.0 #movieclip #ac3 #actionscript3 #twitter #tweet #combining_functions

Heya everyone.

 

Is there a way that I can implement a tweet function into an AIR iOS app? I'm currently developing it in Flash Professional Actionscript 3. I understand that there's a method of doing it in Flex, but I have no knowledge in that area.

 

Thanks .

 
Replies
  • Currently Being Moderated
    Jun 19, 2012 9:35 AM   in reply to BlazeRazgriz

    try using this libary

     

    http://tweetr.swfjunkie.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 11:34 PM   in reply to BlazeRazgriz

    Hi,

     

    If you just want tweet function into an AIR IOS app, then you can use use the following link, only 3 line code. I have used it and it is working fine, the problem is that when you click on the twitter link browser will open and your application goes in pause mode in background, you have to resume it from the apps panel. If you're OK with it, then it will be nice link for you.

     

    http://www.actionscript.org/resources/blogs/52/Facebook-and-Twitter-bu ttons-in-Flash-and-Flex.html

     

    Regards,

    Vipul

     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 8, 2012 7:23 PM   in reply to BlazeRazgriz

    There are three levels of Twitter features you can add to your game.  The amount of work required to add features from these levels increases as the feature level increases.

    The first and easiest feature level is adding one (or more) of four Twitter buttons to your embedding html.

    If you go to https://twitter.com/about/resources/buttons you can pick one (or more) of those four buttons and generate the code needed to add them to your embedding html. Just follow the directions and copy and paste the rendered code into your html document.

     

    The second and third feature level requires use of Twitter's REST API, https://dev.twitter.com/docs/api.  The difference between, what I call, the second and third level is that second level REST API requests require no authentication while third level requests require authentication.

     

    To determine if you need to use authentication, check the REST API.   It looks like there are less than 150 resource requests you can make from Twitter at the time of this writing so it is easy to scan the list to see what requests you need for your game.

    Click on each request you need to see details of the request. Towards the top on the right side is a box title Resource Information that contains a listing, Requires Authentication?

     

    if Requires Authenticaion has anything other than yes, you don't need to use OAuth and don't need to use tweetr.  you can use the urlloader to load make those http requests.

     

    if authentication is required, you have significant work to do.  i found it easiest to use tweetr in that situation.

     

    for all 3 levels, users will need to login to their Twitter account, at least, once.


     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 9, 2012 6:14 AM   in reply to BlazeRazgriz

    Two main steps are needed to use requests that requires authentication. First, you must register your game with Twitter. Second, you must either implement the OAuth protocol or use a library like Tweetr that implements the protocol.

    Game Registration

    To use requests that require authentication (and those for which it is supported), you must first register your game with Twitter at https://dev.twitter.com/apps/new

    Fill out their form, agree with all those rules, prove you are a human being by filling out the Captcha form and click the Create your Twitter application button.

    Copy your Consumer key and Consumer secret. You will need both to make authenticated requests on behalf of users. These numbers are used by Twitter to identify your game when a user gives your game permission to make requests on their behalf.

    Click the Settings tab and add an icon or change your settings, if needed. In particular, note the Application Type settings.  If you need more than read-access, tick the Read and Write or Read, Write and Access direct messages.

    Click the Update this Twitter application's settings if you made any changes or additions.

     

    You don't need to worry about the http requests because your requests are going to use the tweetr api.  but

     

    https://upload.twitter.com/1/statuses/update_with_media.json

     

    is an http request.  if authentication weren't needed and there were no security issues, you could just use that url with an htmlloader.  the loader's complete listener function would contain twitter's response.

     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 10, 2012 8:23 AM   in reply to BlazeRazgriz

    i think twitter made some change that caused tweetr to fail. 

     

    i recently encountered a security sandbox issue when using the tweetr swc for the web.  i removed the the tweetr swc from the library path and used the tweetr source files and edited those to use a gateway php file that allowed my web-based swf to call a local php file and the php file handled the cross-domain twitter request and response. 

     

    but because you're using an air app, you shouldn't have a cross-domain problem testing your installed app. ie, don't test from within flash.

     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 10, 2012 9:37 PM   in reply to BlazeRazgriz

    a cross-domain.xml needs to be on twitter which it there. but it restricts access to twitter domains.  it used to allow cross-domain access but not any more so, that's not any help.

     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 11, 2012 8:20 AM   in reply to BlazeRazgriz

    i used the tweetr source files for a web app.

     

    for an installed app (like air for iOS), you shouldn't have cross-domain problems.  are you testing on an iDevice (you should be) or a simulator on a laptop (where you will have cross-domain issues)?

     
    |
    Mark as:
  • kglad
    72,195 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 11, 2012 11:24 AM   in reply to BlazeRazgriz

    glad to hear that!

     

    (and, you're welcome.)

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 27, 2013 12:39 PM   in reply to BlazeRazgriz

    Hi - how is your twitter app working now - Is Tweetr still working for you ?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2013 2:35 AM   in reply to BlazeRazgriz

    Hi, thanks for the reply. I also got the go viral ANE, but it just allows you to tweet. It does not allow you to look at people's friends, lists, follow, unfollow etc.

    Now that we need to authenticate those things in Twitter API v1.1 it would be great if we had an API similar to the Facebook as3 API.

     

    Cheers

     

    gingerman

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points