Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-14-2009, 09:48 AM   #1 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,070
scotopia is on a distinguished road
Default Twitter/Facebook integration info

Hello All,

I wanted to add some twitter/facebook integration to an app I am working on. Since I frequently hear the terms "twitter integration" "facebook connect" and the like I thought this info would be readily available, but searching these terms on the forums and google pretty much lead me nowhere. Can anyone provide assistance on this; I'm sure its not too bad.

Basically would I would like is to have, on a button press, a screenshot be taken and then uploaded to the users twitter/facebook accounts as a tweet/post with some text that I specify before hand; should hopefully be straightforward. Thanks!
scotopia is offline   Reply With Quote
Old 08-14-2009, 09:53 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Quote:
Originally Posted by scotopia View Post
Hello All,

I wanted to add some twitter/facebook integration to an app I am working on. Since I frequently hear the terms "twitter integration" "facebook connect" and the like I thought this info would be readily available, but searching these terms on the forums and google pretty much lead me nowhere. Can anyone provide assistance on this; I'm sure its not too bad.

Basically would I would like is to have, on a button press, a screenshot be taken and then uploaded to the users twitter/facebook accounts as a tweet/post with some text that I specify before hand; should hopefully be straightforward. Thanks!
Here's what I use for Twitter: Matt Legend Gemmell – MGTwitterEngine – Twitter from Cocoa

And for FBConnect: http://svn.facebook.com/svnroot/plat...ect-iphone.zip
smithdale87 is offline   Reply With Quote
Old 08-14-2009, 09:54 AM   #3 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,070
scotopia is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post

Thanks; I'll give that a looksee!
scotopia is offline   Reply With Quote
Old 08-14-2009, 10:05 AM   #4 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,070
scotopia is on a distinguished road
Default

Looking through the twitter one now; seems cool. Is there any sample code about how to use it to post to the account or do I just gotta sift through all the .h files and figure out what does what? It's worth noting that I'm only interested in posting to the users twitter account for this project (not receiving anything). I've got no problems sifting through everything directly; just looking to save time (also at work on a PC ).

Last edited by scotopia; 08-14-2009 at 10:09 AM.
scotopia is offline   Reply With Quote
Old 08-14-2009, 10:10 AM   #5 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Code:
 MGTwitterEngine* twitter = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitter setUsername:usernameTxt.text password:pwTxt.text];
[twitter setClientName: _TWITTER_CLIENT_ version:_CLIENT_VERSION_ URL:_COMPANY_URL_ token:@""];
[twitter sendUpdate: newStatus];
[twitter release];
Here's how to update user's status. I've never tried posting images before, so you'll have to figure that much out on your own.

Edit:
You'll need to implement several delegate methods as well.
Code:
	#pragma mark Twitter delegate methods
- (void)requestSucceeded:(NSString *)requestIdentifier
{
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Your twitter status was successfully updated." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];	        
     [alert show];
     [alert release];
}
smithdale87 is offline   Reply With Quote
Old 08-14-2009, 10:14 AM   #6 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,070
scotopia is on a distinguished road
Default

K thanks; that should be enough to give me a running start.
scotopia is offline   Reply With Quote
Old 08-14-2009, 11:18 AM   #7 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

You may want to look into oAuth authentication for twitter instead of the user having to input their username/password into your app.

#1 the user cant know for sure that your app isnt sending this info back to your servers.
#2 The users posts will say its posted from: API. When using oAuth it says it was posted from your app and a link to your website or itunes download.

I just setup my app to use twitter. I found one script that made it real easy to register the app to the users account and then found another one that sent messages easyier once authenticated and I now use a combination of the two.


I now need to look into adding facebook support to my app.
MikesTooLz is offline   Reply With Quote
Old 08-14-2009, 11:28 AM   #8 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,070
scotopia is on a distinguished road
Default

Yeah I was just reading about all the oAuth complications on the MGTwitterEngine guy's blog... seems like its a real battle.

I may look into the type of things your doing; although my "screenshot" feature may complicate it. I guess i'll have to have the pic uploaded to something like twitpic and then include that link into the twitter status update....hmm...
scotopia is offline   Reply With Quote
Old 08-14-2009, 11:38 AM   #9 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Mike,

I'm curious about the whole oAuth business, just never had that much time to do the research. It seemed like it was too much work for the effort needed.

Could you outline the process you went through and possibly post the scripts you used to register the app to the users acct, etc ?


Quote:
The users posts will say its posted from: API. When using oAuth it says it was posted from your app and a link to your website or itunes download.
Not entirely true, the user's post actually just says "From Web".
smithdale87 is offline   Reply With Quote
Old 08-14-2009, 11:55 AM   #10 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

Quote:
Not entirely true, the user's post actually just says "From Web".
Nope, twitter changed it and it no longer says "from web" it now displays "From API"

They have to ways of doing oAuth, web and application. I looked into the application versions and it seemed to complicatied for what my app needs (post a simple status message). So i registered on twitter as a web App for oAuth.

#1 The user gets sent to the facebook page for authentication.
#2 facebook calls a PHP script on my site and passes the users secret and key.
#3 My PHP script logs the users secret and Key to a MySQL database assigned matched to the UUID of the users device. Then displays a page saying the registration is complete and the user can continue using the app.

#4 My app can then request the key and secret for the device UUID for the user and send a tweet.



ill try an post some more info on where I found the two scripts I used when I get home.
MikesTooLz is offline   Reply With Quote
Old 08-14-2009, 11:59 AM   #11 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Quote:
Nope, twitter changed it and it no longer says "from web" it now displays "From API"
mehh.. for what it's worth, my last twitter post that I made from one of my apps says
"7:48 AM Aug 6th from web" on it. So unless they've changed it within the last week or 2...
smithdale87 is offline   Reply With Quote
Old 08-14-2009, 01:17 PM   #12 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

Twitter API Change Log.
Feature (REST): API updates are now identified as being from API rather than web
MikesTooLz is offline   Reply With Quote
Old 08-14-2009, 01:59 PM   #13 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

That's odd, to say the least. That change log is from July, yet the app I'm developing still says "from web", even though I've used it after the specified change date.
smithdale87 is offline   Reply With Quote
Old 08-14-2009, 05:16 PM   #14 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

Here you go http://thewificar.com/TwitterScripts.rar

setup the config.php with your database info.
setup secret.php with your twitter app info.

you need to check a few of the files and make sure you replace YOUDATABASETABLE with the name of your database table and also that your table has to corrisponding sections.


#1 the user is sent to your start.php?uuid=XXXXXXXXXXXX
#2 app settings on twitter website should be set to send succesfull login back to confirm.php

#3 Thats it now to update a users status just pass the device UUID and status message like so.
updatestatus.php?uuid=xxxxxxxxxxxxxxxxxx&status=Me ssage to be sent.

Last edited by MikesTooLz; 08-14-2009 at 05:29 PM.
MikesTooLz is offline   Reply With Quote
Old 08-14-2009, 08:31 PM   #15 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

anyone know of an easy to follow tutorial for implementing facebook connect. I imported all the fbconnect files into my project and its compiling ok.

I just need it to let the user update their status when my custom button is pressed.

I would rather not have one of the facebook login buttons and just ask the user for there login info only if they havnt already loged in before.

Last edited by MikesTooLz; 08-14-2009 at 08:37 PM.
MikesTooLz is offline   Reply With Quote
Old 08-23-2009, 08:02 PM   #16 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 1
sautto is on a distinguished road
Default

A quick tutorial to FBConnect.

How To: Implement Facebook Connect on the iPhone in 5 minutes on Vimeo
sautto is offline   Reply With Quote
Old 09-01-2009, 12:20 AM   #17 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 1
prabodha is on a distinguished road
Default MGTwittter Engine

Thanks everyone for your useful discussion.

By the way, does anyone of you save the user credentials once you logged in to twitter using MGTwitter engine, so that when you relaunch the application in your iPhone you don't have to enter user name and password again.

Is there a way to verify user credentials when using MGTwitterEngine in an iPhone app.

Thanks and Regards
Prabodha.
prabodha is offline   Reply With Quote
Old 09-03-2009, 09:10 PM   #18 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
MikesTooLz is on a distinguished road
Send a message via AIM to MikesTooLz
Default

Quote:
Originally Posted by prabodha View Post
Thanks everyone for your useful discussion.

By the way, does anyone of you save the user credentials once you logged in to twitter using MGTwitter engine, so that when you relaunch the application in your iPhone you don't have to enter user name and password again.

Is there a way to verify user credentials when using MGTwitterEngine in an iPhone app.

Thanks and Regards
Prabodha.

You should not be storing a users username and password.
#1 its not secure
#2 the user doesnt know if you are securly storing their info or even sending it back to your servers where you have full access to their account.

They should be loggin in to their account via twitter site and allowing your registered app. You will then get a secret key that lets your app interact with their twitter account.
MikesTooLz is offline   Reply With Quote
Old 09-29-2009, 06:11 PM   #19 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 541
chaseacton is on a distinguished road
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Can anyone please post a simple sample app with twitter and facebook status updates please? It just needs to be barebones.

-Chase
__________________
Freelance Inquiries:
www.chaseacton.com/services

Apps:
chaseacton is offline   Reply With Quote
Old 10-16-2009, 10:48 AM   #21 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Atlanta
Posts: 411
funkytaco is on a distinguished road
Default

Quote:
Originally Posted by chaseacton View Post
Can anyone please post a simple sample app with twitter and facebook status updates please? It just needs to be barebones.

-Chase
I posted some information for the facebook side here and linked to the facebook video.

mirando | iPhone application & web integration

They supply a test app you can use in facebooks developer section.
http://wiki.developers.facebook.com/...ect_for_iPhone
funkytaco is offline   Reply With Quote
Old 10-19-2009, 01:33 AM   #22 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
svveet is on a distinguished road
Default

i dragged the folder to my app, but it says it couldnt find the file.
svveet is offline   Reply With Quote
Old 10-19-2009, 10:11 AM   #23 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Atlanta
Posts: 411
funkytaco is on a distinguished road
Default

You have to add the source path. Look in the project settings for FBConnect. I believe they use ../../ as their source path or something similair. You could also try ./ if it's in the same folder.
funkytaco is offline   Reply With Quote
Old 10-19-2009, 07:17 PM   #24 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
svveet is on a distinguished road
Default

Quote:
Originally Posted by funkytaco View Post
You have to add the source path. Look in the project settings for FBConnect. I believe they use ../../ as their source path or something similair. You could also try ./ if it's in the same folder.
yeap, i found out it was the header search path was incorrect...
im wondering, do we need to copy the entire "fbconnect-iphone" folder to our app? or it can be just a reference outside of the app folder?
svveet is offline   Reply With Quote
Old 10-19-2009, 10:11 PM   #25 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
svveet is on a distinguished road
Default

Im just implement facebook connect to my app, it runs perfectly on simulator,

but when i try to run it on my iphone, it shows the following error.



does anyone know whats the problem here?

Thanks
svveet is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 313
12 members and 301 guests
chiataytuday, coolman, givensur, glenn_sayers, guusleijsten, jbro, mediaspree, mottdog, mtl_tech_guy, Punkjumper, vilisei, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:24 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0