Error 403 while getFollowers : Twitter iPhone MGTwitterEngine

I was trying to access the followers list from my twitter account by using MGTwitterEngine. But it is giving error. Here is all step what i have done to fixed it.

1. In MGTwitterEngine.m change #define TWITTER_DOMAIN @”twitter.com” To #define TWITTER_DOMAIN @”api.twitter.com/1″

and  #define USE_LIBXML 0 to #define USE_LIBXML 1 (Most of the people are not doing this and getting no response)

2. In your working class.h add #import “MGTwitterEngine.h” and add its delegate <MGTwitterEngineDelegate>

3. In your working class.m add these methods:

#pragma mark TwitterEngineDelegate
– (void) requestSucceeded: (NSString *) requestIdentifier {
NSLog(@”Request %@ succeeded”, requestIdentifier);
}
– (void) requestFailed: (NSString *) requestIdentifier withError: (NSError *) error {
NSLog(@”Request %@ failed with error: %@”, requestIdentifier, error);
}
– (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier {

}
– (void)receivedObject:(NSDictionary *)dictionary forRequest:(NSString *)connectionIdentifier {

NSLog(@”Recieved Object: %@”, dictionary);
}
– (void)directMessagesReceived:(NSArray *)messages forRequest:(NSString *)connectionIdentifier {

NSLog(@”Direct Messages Received: %@”, messages);
}
// This method will call when you received all your followers. I have used one NSMutableArray “friendsList” to store all followers information. You can modify this according to your need.
– (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {

NSLog(@”User Info Received: %@”, userInfo);

friendsList = [[NSMutableArray alloc]init];

for (NSDictionary *u in userInfo ) {

NSDictionary *followersDic = [[NSDictionary alloc]initWithDictionary:u];
[friendsList addObject:followersDic];
[followersDic release];
}
[self.tableView reloadData];
}

This is all what i have added in my class and then calling this method: [[GetAppDelegate() facebook] requestWithGraphPath:@”me/friends” andDelegate:self]; And it return all my followers list.

I hope this code will help to those who have scratching his head from some couple of hours 😉

!! Enjoy !!

This entry was posted in iOS, Technology and tagged , , by Muzammil. Bookmark the permalink.

About Muzammil

Hey Guys, I am Muzammil Mohammad. Having 7 years of experience in iOS development. I am here to share my knowledge with all mobile application developers and those companies who are stuck on development (due to bad quality of code or don't know what to do) or want to know how to build a good mobile app. I believe I am more expert in UI and Architecture design of mobile app. So if you need my helps or assistant for your mobile app projects, Feel free to contact me. I will try my best to improve the quality of your app. Or you can hire me to develop your apps. I’d love to talk with you. Best!

14 thoughts on “Error 403 while getFollowers : Twitter iPhone MGTwitterEngine

    • How true. But what happens when that iduviidnal, after having put in his best (for which he was rewarded), is deemed incompetent, is a question that organisations should ask themselves. Do you try to accommodate him? Do you try to move him out? Is it possible that you give him back his core area so he can excel there? Do you provide inputs to fill in his competency gaps? Or you happy to let him go because he has served his purpose and someone fresh and less expensive comes along?

  1. I am also facing the same problem even i followed the above steps.
    [[GetAppDelegate() facebook] requestWithGraphPath:@”me/friends” andDelegate:self];
    i am not getting where i have to call this method.can you suggest me.

    • Which is why it is true (especially at senior lelevs) quick promotions and role changes are not good. As much as organization’s view of you is important, your view of yourself and your abilities is also important. Organization’s intention is not to bust you but identify the CEOs of tomorrow. If our of 10 people that move up quickly, 9 fold and 1 succeeds, the method was worth trying from their perspective.

  2. hi,my requirement is getting the followers names,
    I am also facing the same problem even though i followed the above steps.
    I have one doubt that
    [[GetAppDelegate() facebook] requestWithGraphPath:@”me/friends” andDelegate:self];
    where i have to call this method in my app.iam confusing,can you please suggest me…..

    • Let me start by saying nice post. Im not sure if it has been taelkd about, but when using Chrome I can never get the entire site to load without refreshing many times. Could just be my computer. Thanks.

  3. Hi Srinivas. In my case i have allocated the Facebook in App delegate with object name facebook. And i have created one function “GetAppDelegate()” which return app delegate (i.e. [[UIApplication SharedApplication] delegate] ).
    And i am calling this “facebook” from some other class. by using the method:
    [[GetAppDelegate() facebook] requestWithGraphPath:@”me/friends” andDelegate:self]; In your calling class write all delegate methods of facebook. As i am giving this delegate self. I hope now you understand what i have done with my code. If you still face any issue..let me know. I will try to fix your problem. Thanks

    • Hi Marco,I think with all the support from Morzilla, Ibm and W3c Gmail today is the iaedlng player in the market just behind yahoo in India. I think it mostly used by corporates due to its simplicity and easy navigation Gmail will become Market leader in time to come.Thanks!

    • Xeno Gears was a pain to play during my days bseauce I can’t find the secret places and secret stuff but now with the internet booming i can always use cheats to help me along the way although it takes away a lot of fun in the process

  4. Thanks Muzammil.I have done with twitter integration successfully by your suggestions but for facebook,i have connected through fbgraph-api, friends list i have to display in tableview by using the lazy loading concept.Now iam able to displaying the friends in table but my requirement is to use lazy loading concept.can you suggest me with the useful links,Thanks in advance….

  5. @Srinivas: Lazy loading for friends list (name) or for friends images ?? If you like to use the lazy loading for friend’s images create your own NSOperationQueue in place of downloading images by using the NSData dataWithURL method.

    • Hi Muzammil:Thanks for the reply..I have to use Lazy Loading concept for friends list names only.what is the best method to do?Thanks

      • In marketing world, cuemrtsos are usually remembered when the marketer is talking to them. However, when the conversation is over they are forgotten. Oftentimes people won’t care anymore how much the price is, they are concern on how they are valued and remembered. In the end, building relationships is offering far better results than building links!

Leave a Reply

Your email address will not be published. Required fields are marked *