OWActivityViewController is a fork of REActivityViewController, with no external dependence. only support iOS integrated Social Network (for iOS 6: Twitter/Facebook/SinaWeibo, for iOS 5: Twitter).
Here is REActivityViewController dependencies:
AFNetworking ~> 1.1
Facebook-iOS-SDK ~> 3.2
DEFacebookComposeViewController ~> 1.0.0
REComposeViewController ~> 2.0
PocketAPI ~> 1.0.2
SFHFKeychainUtils ~> 0.0.1
AFXAuthClient ~> 1.0.5
For some one only want their apps the same behavior as pre installed apps (such as Photos app) under iOS 6 (show Twitter/Facebook/SinaWeibo as share options, even if corresponding account is not set up in iOS Settings.), and provide modern UI under iOS 5, there is no need to depend on lots external libraries.
REActivityViewController is more powerful, but OWActivityViewController is more slim; they are different.
The twitter framework apple has added is a Christmas gift to all the iOS developers as twitter integration has now become a child's play. By using the twitter framework you may now post your stuff to twitter but a user only have to connect to Twitter with his account once and he/she can do this in the setting section of the iPhone or iPod and look for the twitter app settings. After that, apps have the possibility to post a tweet with the users account.
TWTweetComposeViewController class in the twitter framework makes every thing possible if you want to tweet in the iOS 5 but if you want the twitter integration in the other devices then in that case you have to use the old methods of tweeting and in case if your application has support from iOS 4 to iOS 5 then in that case you need to perform a check and then tweet happily ever after .
In this tutorial I’m going to show you how to use this class and start using the Twitter integration. You will be surprised how easy this class is to implement. Check the end of this article for a sample project you can download.
Almost a year and a half ago I first mentioned the ShareKit library for enabling social sharing within iOS apps for urls, files, images, and text to many different social networks including Twitter, Facebook, and Tumblr (among others).
This library became extremely popular because with just a few lines of code you could implement social sharing with a very well made interface.
For some time there have been some issues with the library, but the official build was not updated, and updates have been very infrequent at the official repository. This meant you likely had to tweak it yourself or go searching for a working fork if you wanted to use it in a project.
This is now the ShareKit community repository and includes many updates from numerous forks, and the version has been updated to 2.0.
This build provides numerous fixes, includes support for more social networks (LinkedIn, FourSquare) uses native iOS Twitter support, and promises more frequent updates.
In iOS 5, Apple introduced tighter twitter integration with Twitter.framework and Accounts.framework.
Most of the latest “social” apps out there use some kind of frameworks to send out tweets from their app. With iOS 5, you no longer need to build your code against all these frameworks. iOS 5?s built in Twitter.framework manages most of these issues automatically. In this tutorial, we will go through how to use the built-in framework to send a tweet.
Note that this tutorial uses screenshots from Xcode 4. By now, you should all be using Xcode 4 and should have uninstalled Xcode 3 completely.
Step 1: Add the Twitter.framework and Accounts.framework
Open your target on the project navigator to your target’s build phase.
Click the “Link Binary with Libraries” section (illustrated above) and expand it. Click the “+” button to add a new framework and select “Twitter.Framework” to this project.
Step 2: Weak or Strong?
If you are planning to support iOS 4 (Doh!, you ought to man), you have to weak-link this framework. Click on Twitter.Framework and change the “Required” drop down to “Optional”.
If you decided to be hippy and prefer to support only iOS 5 (like the attached source) you can ignore this step.
You create an instance of TwTweetComposeViewController, set the tweet you want to send and present it to the user.
Before you can do that, just as in the case of In app Email or SMS, you need to check if the device is capable of sending a In-App Tweet.
There could be two cases when you will not be able to send an in app tweet. First, if the user haven’t yet updated to iOS 5. Second, if the user haven’t configured his twitter accounts in the settings page.
The first case will not happen if you are planning to restrict your app to iOS 5. But in case you followed Step 2 and are weak-linking your Twitter.framework, you have to check if the class TwTweetComposeViewController is present using the Objective-C runtime method NSClassFromString.
If it returns nil, return and error, otherwise, call the class method, canSendTweet.
In iOS 5, not just the TwTweetComposeViewController, but a lot of similar methods use completionHandler to notify the caller of status instead of delegates. So if you use TwTweetComposeViewController, it means you have to be on a minimum of iOS 4 even if you weak-link your framework.
Contrary to the popular belief, completionHandlers are much more cleaner and easy to understand that delegates. For example, in our case, our completionHandler looks like this
You can add UIAlertViews or similar constructs when tweet sending fails here.
So, that’s it! Wasn’t it easier than the traditional methods? Remember oAuth, MGTwitterEngine, xAuth, setting up accounts, getting xAuth from Twitter, and all other blah blah stuff?
Heck it was easier than even In App Email/SMS! However all these don’t come for free.
The only biggest drawback I could think of is, your app doesn’t get any attribution for the tweets sent. Twitter.com or any client shows that the tweet was sent “via iOS” instead of your app name and I don’t see a way to set this up in the Framework.
This shouldn’t be a problem since Twitter is slowly “abandoning” the via text (at least on the stream page now). So what? Let’s start using Apple’s Twitter.Framework from now on, instead of the third party frameworks.