Twitter SDK on iOS with standard UI - iphone

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

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.

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

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 official Twitter Kit SDK support was discontinued in 2018.
As an alternative solution for displaying Tweets in your app without Twitter Kit, you can render Embedded Tweets and Timelines within webviews using Twitter for Websites.
Check out this link:
https://medium.com/#musmein/rendering-embedded-tweets-and-timelines-within-webview-in-ios-e48920754add

Related

Codename One - Facebook Marketing API

I was looking for a way to integrate my CodenameOne app with Facebook. Particularly to collect data aimed to improve the adds shown on Facebook to users who have, for example, installed the app. What I found for integration with Facebook on CN1 is (mainly) this https://www.codenameone.com/javadoc/com/codename1/social/FacebookConnect.html
This seems useful for publishing photos or posts to Facebook as a user, but not for gathering data as I need it. Is there a way to access this part of the Facebook SDK in CN1? If there isnĀ“t is this planned for the future?
The connect API is designed for authorization and authentication which need to be native. From that point on you can use the token against the standard Facebook Graph API.
I'm not really familiar with the marketing API but does it require functionality from the native SDK which isn't available in the current SDK?

How to authenticate with Foursquare OAuth2 within a jQueryMobile app (no useragent flow)

I am building a mobile app with jQueryMobile and I intend to deploy it onto iPhone thanks to PhoneGap.
My question is : how can I authenticate myself with Foursquare using the OAuth2 protocol in my jQueryMobile app ? One solution would be to use the useragent flow of OAuth2 but this would force the iPhone to launch Safari and thus not stay within the app. Are there any better solutions than this ?
For an iPhone-based or client-side application like you would have in PhoneGap,
Foursquare recommends one of these methods.
If you have no substantive server code, you can embed a web browser and use the token flow, redirecting the user to a dummy page on your domain. You can then grab the token off of the URL and close the browser. We have sample Android and iOS code for your reference.
If you have a server as part of your application, you can use the server flow above, possibly in an embedded browser. Similar to the Facebook API, you can add display=touch to your authorize or authenticate URLs to get a mobile optimized interface.
An alternative to the above is to use the server flow and an external browser, but redirect to a custom URI handler that brings the user back to our application. You can embed the secret in your application and exchange the provided code for an access token. PLEASE take steps to obfuscate your client secret if you include it in released code, and be prepared to rotate it if needed.
https://developer.foursquare.com/docs/oauth.html
This could probably be handled with the ClientBrowser plugin for PhoneGap or just adapting the sample code they have provided into PhoneGap plugins.
One of the core intentions of OAuth2 is to not allow browserless authentication flow like we did with XAuth in the past. Service providers want consumers to see what permissions they are signing off on, and want control of that process.
I'm not very experienced with Phonegap, as I'm a native developer, but if there's a way of instantiating a UIWebView and showing it to the user, you could at least keep the web interaction 'inside' of the application. Given phonegap is basically showing a UIWebView this should be possible. It is possible to examine the source of the html within a UIWebView using
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script

Facebook and Twitter Integration with LWUIT 1.4

I am developing J2ME app using LWUIT 1.4 API.
I need to integrate with Facebook and Twitter.
How to do it? Is there any source code that I can learn?
LWUIT4IO which is currently only available in the SVN LWUIT trunk ( http://java.net/projects/lwuit/sources/svn/show ) includes basic support for Twitter and is supposed to get Facebook support within a couple of weeks. Twitter support though is read-only since when that was implemented Twitter only had deprecated basic authentication and OAuth 1.x which is problematic (requires MD5 which means export restrictions etc.).
However, Terrence used a 3rd party library to handle Twitter interaction with LWUIT and has open sourced his work. For more details of what he did see his post here http://terrencebarr.wordpress.com/2011/05/06/beyond-smartphones-source-code-video-released/
Codename One has new facebook integration that actually works on both simulator and devices. Twitter integration will be landing soon as well.

Facebook app - Where to start?

I have read many articles about facebook apps, but I can't find anything what I need. Is it possible to create an App for Facebook with HTML/ CSS / Jquery without to using FBML and load this app from my server? Is it possible to use in this app the facebook functions like share, add app to my account etc? Is there any doku or example apps, where I can take a look?
Thanks
Nik
What delayed my app getting to work was realizing that the canvas URL request is HTTP POST - not HTTP GET as otherwise usual. A simple way to start is looking at example apps that have their source code open. There're examples both for PHP and python at the developer pages. A good example of a simple facebook app that uses google app engine is runwithfriends
FBML is in the process of deprecation in favor of the Graph Api for quite a while now.
Excerpt from http://developers.facebook.com/docs/reference/fbml/:
We are in the process of deprecating FBML. If you are building a new application on Facebook.com, please implement your application using HTML, JavaScript and CSS. You can use our JavaScript SDK and Social Plugins to embedded many of the same social features available in FBML. While there is still functionality that we have not ported over yet, we are no longer adding new features to FBML.
The Graph Api is easily accessible through JavaScript.
For a quick start you can use this page as a start.
First of all, fbml is not supported anymore. so forget about that.
You can write your fb app in many languages, for example you can do it in Ruby on Rails, PHP, or C#/ASP.NET etc, whatever you prefer (although you might want to look if there are some frameworks available for your platform, for using facebook. will make your life easier).
Then, setup your app from facebook developer to match your ip, and you're set to go

Facebook authentication with new 'Facebook SDK for iOS' vs. old 'Facebook iPhone SDK'

I'm working on integrating Facebook with my iPhone/iOS application and I want to know if I'm understanding the nature of the login procedure correctly.
With the old Facebook SDK ('Facebook iPhone SDK'), when we needed to request authentication permission from a user a UIWebView would be displayed with a login prompt. With the new SDK ('Facebook SDK for iOS'), the SDK uses Apple's fast-app-switching feature to temporarily place the app in background mode and then load the iOS Facebook app or Safari to authenticate. Is this basically the gist of it?
I've experimented with authenticating my app via the new SDK's technique and due to the nature of my app, it just can't support backgrounding. Does this mean I have to use the old SDK to launch a UIWebView-based authentication? I think this implementation is a lot cleaner anyway. Will I run into any major disadvantages from doing this?
Check out this question and my answer: Iphone facebook connect example calls safari. I don't want to use safari
You can make it use the UIWebView always. Facebook is trying to make it so the user only has to log in once per device (through either the Facebook app or in Safari) but I didn't like this flow (especially on the iPad). Though I'd rather not muck around with the Facebook code, I did find commenting out a few lines to be a quick way of getting the old behavior back.
I don't believe this is the case.
The Facebook SDK that I'm aware of, available at https://github.com/facebook/facebook-ios-sdk doesn't do anything like you describe. Is this the SDK you're using? I believe the last major update to this SDK from the "old" facebook SDK was to add support for OAuth-style authentication. With this change they broke code compatibility so apps were forced to make changes to incorporate the latest SDK.
When you call 'authorize' in this SDK you pass the app id, the desired permissions, and a callback delegate for notifications of errors or success (did login, did not login, did logout). You can also set any access token that you might have persisted from a previous session. Facebook validates this access token, and if it doesn't exist or is invalid it presents a modal login dialog. I believe the content of this dialog is a web page. The SDK authenticates the user using OAuth and makes the auth-token available for persisting between sessions.
At no time is the app exited to run the Facebook app or Safari. I'm curious - what led you to believe this was the case? (Or, perhaps there is some other SDK out there I'm unaware of?)
Take a look on this page: https://github.com/facebook/facebook-ios-sdk
And look at Single Sign-On. That describes the above scenario with fast switching.