Twitter SDK on iOS with standard UI

2019-02-04 15:27发布

I am looking for the SDK to integrate Twitter into my iOS App. I have done research, and seem that MGTwitterEngine is what most people recommend. However, MGTwitterEngine only provides access to the Twitter API, but not the UI.

I also looked a few iPhone app with Twitter integration, such as SCVNGR, FriendsAroundMe, Hashable, they all have the same login page. However, I couldn't find out what SDK these apps use.

I wonder whether there is any SDK release (from Twitter would be the best), which includes both the SDK with standard UI implementation, and some demo code.

Thanks for your advice.

Steve

3条回答
别忘想泡老子
2楼-- · 2019-02-04 15:49

You can integrate Twitter via Twitter API which requires OAuth. And OAuth requires web-browser in any form. All the other parts can be done without web-browser, but authentication requires it.

You can hack those OAuth web pages in background via UIWebView's JavaScript interface, but the log-in page changes often. And your users will experience log-in trouble until you update hacking algorithm.

In fact, Twitter offers another authentication method called xAuth. You can authenticate completely in background without browser with this protocol, but you have to be approved about using of this protocol from Twitter company via direct contact. I don't think regular startup service can acquire the approval.

I don't think OAuth offer any better security or protection, but this is the only card which I can use without trust from Twitter.

查看更多
The star\"
3楼-- · 2019-02-04 15:50

The login UI for these apps is probably a UIWebView. I say probably because I haven't seen those apps that you've mentioned. The login for Twitter is usually handled in a UIWebView, because Twitter requires OAuth. Since the login is done in a UIWebView, Twitter actually provides that UI.

I would recommend ShareKit for basic Twitter interactions, like posting. ShareKit handles the UIWebView for you. edit: ShareKit (0.2.1) seems to have some memory leak issues. Use at your own risk.

查看更多
冷血范
4楼-- · 2019-02-04 15:56

I have a project that builds oAuth and streaming on top of MGTE. The project includes a demo that does authentication in a web view, and streams tweets to a table view.

https://github.com/TimShi/TSTwitterEngine

查看更多
登录 后发表回答