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.

有帮助吗?

解决方案

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.

其他提示

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top