iPhone: what is the delegate for following users in MGTwitter engine - iphone

Can you tell (Twitter)
the delegates for following friend in twitter and getFollowersIncludingCurrentStatus this for followers

enableUpdatesFor: takes an NSString of the username. It's a method not a delegate.

Related

How would I issue two Facebook request in the same class? iOS SDK

I want to get all photos from the different albums of a user. So I write a request me/albums then in didLoad I get an array of albums, which I can use the id of each album to issue a new request albumId/photos but how should I do that? Should I add the request in the didLoad, but then, how would I know them apart?
Ok this is how I do it might not be the best way to go about it but it works. In the did load
-(void)request:(FBRequest *)request didLoad:(id)result {
NSString *requestType =[request.url stringByReplacingOccurrencesOfString:#"https://graph.facebook.com/" withString:#""];
NSLog(#"request %#",requestType); }
Now the requestType would be either me/albums or albumId/photos. Put in a couple a conditional if-statements and you are good to go. And yes you can add the new request for fetching photos from the albums in the didLoad in the if condition that matches me/albums (meaning you got some result for that request ie the albums array). The next time you hit the didLoad it would be for the photos in the albums. Hope that helps.
you could also keep the refs to the FBRequest instance returned by each requestWithGraphPath call and match them with the ref. you get when the delegate methods are called back.

Facebook Logout in iPhone Application

I have integrated the facebook in to my application, From the FB i will be getting the userid and the name of the user and passing it to my own service that will do the validation and allows the respective user to get in to the system. I have got the userid and username from the FB and passed it my service that will do the validation,it allows the user to enter in to app, but my problem is once i logged in , how can i log out from the FB ?
Please let me know your ideas.
Thanks
If you are using the new facebook sdk, then us
[facebook logout:delegate]
Being facebook your Facebook object,and delegate an FBSessionDelegate.
If all goes well your delegate will be called on -(void)fbDidLogout;
That depends on which library you use to connect to facebook.
But I guess that you have a FBSession class that has a logout method...
That logout method also calls deleteFacebookCookies that you could also directly call depending on your needs...
Hope that helps.
If you are using old facebook sdk,then use this code for logout.make FBSession class object and code like this. [FBSessionclassobject logout];
it will delete all FacebookCookies.

How to send direct message with Twitter?

in my iphone application i have to send direct message throughout twitter,
the problem is that twitter had changed the authentication from basic authentication to oauth
and tutorial on the Web are out of date
so i use SAOauthTwitterEngine for the authentication part and all ok. but these classes don't use the api, so i have to use MGTwitterEngine for this.
the problem is that MGTE dont have oauth but only xauth and basic authentication, and i cant use this together anyone know how to do it? or know a tutorial that explain it.
thanks a lot.
i suggest you OAuth because xAuth requires you to send an email to twitter askeing them to give you the permission, and you have to write a reort on your application (this isn't good for a testing app)
have you tried this?
https://github.com/bengottlieb/Twitter-OAuth-iPhone
in my app I am sending direct messages to my twitter followers by using MGTwitterEngine let have a look:
appDelegate._engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate: self];
appDelegate._engine.consumerKey = kOAuthConsumerKey;
appDelegate._engine.consumerSecret = kOAuthConsumerSecret;
once you get authenticated this method get called
#pragma mark SA_OAuthTwitterControllerDelegate
- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *)username {
NSLog(#"Authenicated for %#", username);
[appDelegate._engine sendDirectMessage:#"Test for Twitter direct message" to:username];
}
Hope this will help you.

How to integrate location information into Twitter app?

I'm trying to get a Twitter iPhone app working using Matt Gemmell's MGTwitterEngine. I can post tweets OK, but I can't work out how to attach location data to those tweets... anyone have any idea?
I've never used MGTwitterEngine but from looking at the code, it should be as simple as calling sendUpdate:withLatitude:longitude:. What have you tried? What did and what did not work? Please be more specific.
There is no way to do post tweets with location information with MGTwitterEngine as of now. I am currently working on bringing the library up to date. You can check github.com/freeatnet/MGTwitterEngine/tree/v2-dev for updates. I'll be pushing a commit containing a method for geo-aware updates today.
UPD. See commit # http://github.com/freeatnet/MGTwitterEngine/commit/512be99cca9f5787192633455300dcd788c7830c for location-aware updates.
Method signatures:
(NSString *)sendUpdate:(NSString *)status;
(NSString *)sendUpdate:(NSString *)status fromLocationLat:(float)locLat locationLong:(float)locLong;
(NSString *)sendUpdate:(NSString *)status inReplyTo:(unsigned long long)updateID fromLocationLat:(float)locLat locationLong:(float)locLong;

MGTwitterEngine getting feeds - iPhone

So, in my app, I am trying to use MGTwitterEngine to read from a certain user on Twitter, and then log the recent posts in an array. Is it possible to do this with this library? I am trying to do this without logging in. Any help would be appreciate, thank you!
It can be easily done with MGTwitterEngine. You do it this way:
MGTwitterEngine *twitterng = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterng getUserTimelineFor:#"userName" sinceID:0 startingAtPage:0 count:8];
and it will call delegate method
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier
Hope this helps.
You need to get the feed url that contains the rss feeds. You don't need to login for that. Use MGTwitterEngine to get the tweets and set them into array. Then you simply need to reload the tableview.
Hope this helps.
Thanks,
Madhup