Photo

Twitter Oauth Changes And Instatwit


  • Please log in to reply
14 replies to this topic

#1 Tracey_cp

Tracey_cp

    New Member

  • O'Reilly Author
  • Pip
  • 6 posts

Posted 02 September 2010 - 09:46 AM

Hi All!

As you may know, as of yesterday, Twitter will only be supporting applications that work via OAuth (as opposed to Basic Auth). Instatwit (the example app from chapters 2 & 3) has some "Twitter Black Magic" in it that used to provide the Basic Auth code that allowed you to tweet to your actual Twitter account. Now, it doesn't work.

The iPhone code and examples are fine, you just can't get the tweet out to Twitter, for now. We're trying to see if there's a workaround that is relatively easy to implement. For now, we know it's broken!

Thanks!
Tracey

---
Tracey Pilone
Author, Head First iPhone Development
Tracey Pilone
tracey@pilone.org
Co-Author
Head First Algebra
Head First iPhone Development

#2 AndyElliott

AndyElliott

    Active Member

  • Members
  • PipPip
  • 24 posts
  • Gender:Male
  • Location:Brentwood Tn.

Posted 08 September 2010 - 09:20 PM

Hey Tracey!
Thanks for the update! No worries.
I love the book format.
So much better than most.
I've gotten some laughs from it.
Keep up the good work.

Andy Elliott
www.AndyElliott.us
www.NashvilleHomeHQ.com
mac@AndyElliott.us

#3 JTavenner

JTavenner

    New Member

  • Members
  • Pip
  • 1 posts

Posted 15 September 2010 - 12:04 PM

I have temporary work around to let you finish the chapter. You can replace the Twitter Black Magic code with the code below and it will display your tweet in a message box on the iPhone.

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Tweet"
message:themessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
[alert release];

#4 tbrentlong1

tbrentlong1

    New Member

  • Members
  • Pip
  • 1 posts

Posted 12 December 2010 - 05:37 AM

Looking forward to correction. I couldn't believe they were passing a username and password on a URL anyway. BTW: Enjoying the book a great deal - thanks for the refreshing candor. It certainly breaks the traditional...

//dang...hope this code is right
if ([audience isTechnical]) {
[manuscript removeAttributeWithName:@"Fun" includeTediousDetails:YES];
}

I'm coming at this from about 15 years of Microsoft development (VB and then C#, so I bypassed C and C++), so it's nice to see something so very clear and straightforward -- one less thing to clutter up my thoughts as I try to cope with only having one mouse button and attempt remember <apple-right arrow> to get to the end of a line instead of <end>.

bl

#5 Jenson.Chew

Jenson.Chew

    New Member

  • Members
  • Pip
  • 1 posts

Posted 03 January 2011 - 12:45 AM

I'm looking forward to solution too, since OAuth is the basic requirement for any apps to send tweets to Twitter.com.

I'm beginning to follow the Head First iPhone Development closely now as I'm now tasked to take over a prototype iPhone apps with limited functionalities and merely to show case the capabilities to consume web services and access local storage, and to convert it into a fully functional application.

Thanks, and Head First searies are always my first choice when it comes to learning new stuff! Great work!

Cheers,
Jenson

#6 jaakl

jaakl

    New Member

  • Members
  • Pip
  • 1 posts

Posted 27 January 2011 - 12:07 AM

I found an easy solution: with even less lines than in original code.

1. install ShareKit http://www.getsharek...stall/#download

2. configure SHKConfig.h as instructed, set twitter keys. Define app in twitter if needed.

3. add to InstaTwitViewController.h:
#import "SHK.h"
#import "SHKTwitter.h"

4. add to InstaTwitViewController.m sendButtonTapped method:
SHKItem *item = [SHKItem text:themessage];
[SHKTwitter shareItem:item];

This should do it

#7 Nareille

Nareille

    New Member

  • Members
  • Pip
  • 3 posts

Posted 17 February 2011 - 02:08 AM

I just wondered if there is no other solution by now. Just some easy code to fill in, like before.

#8 jmedaugh

jmedaugh

    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 February 2011 - 08:53 AM

My personal recommendation would be to finish up this app using facebook status updates instead of twitter. They have a iOS library called FBconnect that is fairly standardized and well documented, whereas there doesnt seem to be a clear front runner for best twitter library. It was fairly easy to setup.

That said I would love to see some supplemental materials on Oauth for iOS so we don't have to twiddle our thumbs until someone else comes out with a library for whatever the latest hot web service is.

#9 krpettersen

krpettersen

    New Member

  • Members
  • Pip
  • 1 posts

Posted 20 February 2011 - 11:48 PM

I tried this solution. I really wanted to see the twitter app work. It was really simple to add ShareKit to my app. It worked from the start, and was easy to configure. There is good documentation, and I can see using this further. It is more than just a way to 'update Twitter'.




QUOTE (jaakl @ Jan 27 2011, 12:07 AM) <{POST_SNAPBACK}>
I found an easy solution: with even less lines than in original code.

1. install ShareKit http://www.getsharek...stall/#download

2. configure SHKConfig.h as instructed, set twitter keys. Define app in twitter if needed.

3. add to InstaTwitViewController.h:
#import "SHK.h"
#import "SHKTwitter.h"

4. add to InstaTwitViewController.m sendButtonTapped method:
SHKItem *item = [SHKItem text:themessage];
[SHKTwitter shareItem:item];

This should do it



#10 Daniela Vieira

Daniela Vieira

    New Member

  • Members
  • Pip
  • 1 posts

Posted 12 March 2011 - 04:44 PM

I've done this today and it's work perfectly.
Thanks a lot! rolleyes.gif

Daniela


#11 zmarkrun

zmarkrun

    New Member

  • Members
  • Pip
  • 1 posts

Posted 13 March 2011 - 06:38 PM

QUOTE (Daniela Vieira @ Mar 12 2011, 04:44 PM) <{POST_SNAPBACK}>
I've done this today and it's work perfectly.
Thanks a lot! rolleyes.gif

Daniela


While configuring the twitter in SHKconfig.h, what are the other things I need to set other than the SHKTwitterConsumerKey, SHKTwitterSecret ? For me it initiates the Oauth process and on successful authentication it redirects back to the website only, not to the application.
How to get around it...

#12 Crab

Crab

    New Member

  • Members
  • Pip
  • 3 posts

Posted 21 April 2011 - 06:05 AM

Okay.. no freakin' way using the ShareKit is trivial to a brand new programmer.. This had been a pretty neat application and I was using this book with students as one of the texts in an intro programming course with Objective C.. But I don't see this solution as trivial. Sure maybe less code. But the process of downloading, installing, configuring plus some other odds and ends; and then trying to explain that process is way outside the scope of what I wanted to do with students in just getting the message to twitter.

I'm hoping someone will find a relatively simple way to use the newer authentication API.


Dave

#13 Crab

Crab

    New Member

  • Members
  • Pip
  • 3 posts

Posted 21 April 2011 - 06:12 AM

Okay.. I take it back..

It is not trivial to use OAuth

Dave

#14 fabiogarcia

fabiogarcia

    New Member

  • Members
  • Pip
  • 1 posts

Posted 07 August 2011 - 05:38 PM

Hi jaakl!

I'm new with IOS.
Actually starting today!

Can you please upload this project solved?
I've tried following these steps below without success.

Thanks

Fábio Garcia



I found an easy solution: with even less lines than in original code.

1. install ShareKit <a href="http://www.getsharek...tall/#download" target="_blank">http://www.getsharek...l/#download</a>

2. configure SHKConfig.h as instructed, set twitter keys. Define app in twitter if needed.

3. add to InstaTwitViewController.h:
#import "SHK.h"
#import "SHKTwitter.h"

4. add to InstaTwitViewController.m sendButtonTapped method:
SHKItem *item = [SHKItem text:themessage];
[SHKTwitter shareItem:item];

This should do it



#15 LibbyLou143

LibbyLou143

    New Member

  • Members
  • Pip
  • 1 posts

Posted 08 March 2013 - 07:35 AM

Have there been any updates to the Twitter API?
Is there any way to connect my chapter 2 iPhone app to twitter?
I'm new to iOS, so please forgive my lack of knowledge.

Libby




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

"