Pergunta

How we can embed twitter news feed in ios application? first of all it is possible or not? If possible than how? Please keep in mind i'm not asking about embed user time line i'm asking about embed twitter news in application, just like see this webpage.

Foi útil?

Solução

Follow below steps.

  1. Login to your account

  2. Visit https://twitter.com/settings/widgets

  3. Create widget and set design

  4. Copy code and create HTML file.

  5. Open HTML file in webview.

You are done.

Outras dicas

Yes, it's possible. You can use Twitter Kit to embed things if you're using iOS (or Android for that matter). Check out the documentation over a Twitter.

I'm not sure what you mean about not embedding a user time line, since you're then linking to a twitter account which can be embedded as a user timeline.

So, if you want to embed @BreakingNews you could do:

#import <UIKit/UIKit.h>
#import <TwitterKit/TwitterKit.h>

@interface FABUserTimelineViewController : TWTRTimelineViewController
@end

// FABUserTimelineViewController.m
#import "FABUserTimelineViewController.h"
#import <TwitterKit/TwitterKit.h>
@implementation FABUserTimelineViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  [[Twitter sharedInstance] logInGuestWithCompletion:^(TWTRGuestSession *guestSession, NSError *error) {
    if (guestSession) {
      TWTRAPIClient *APIClient = [[Twitter sharedInstance] APIClient];
      TWTRUserTimelineDataSource *userTimelineDataSource = [[TWTRUserTimelineDataSource alloc] initWithScreenName:@"BreakingNews" APIClient:APIClient];
      self.dataSource = userTimelineDataSource;
    } else {
      NSLog(@"error: %@", [error localizedDescription]);
    }
  }];
}

@end
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top