TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Depends on: | |
Facebook-iOS-SDK | = 3.1.1 |
REComposeViewController | = 0.0.1 |
cocoa-oauth | = 0.0.1 |
A sharing controller that allows anyone to implement sharing into their projects easily. iOS 6 will use the new activity view controller while iOS 5 will use action sheets. Readability, Pocket, and Instapaper are added also for read-later services to share with articles.
import "ShareThis.h"
[ShareThis startSessionWithFacebookURLSchemeSuffix:pocketAPI:readabilityKey:readabilitySecret:];
Make sure that the url scheme that you enter is all lower-case. Set to nil or empty string if not planning on using the same Facebook App ID on multiple apps. Pocket and Readability parameters are also optional. If given a nil, those sharing options will not be available.
[[NSNotificationCenter defaultCenter] postNotificationName:AppDidBecomeActiveNotificationName object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:AppWillTerminateNotificationName object:nil];
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [ShareThis handleFacebookOpenUrl:url]; }
Key:FacebookAppID
Value:Your Facebook app ID
Key:URL types --> Item 0 --> URL Schemes --> Item 0
Value:"fb"+value of your Facebook app ID+url scheme (make sure url scheme is lower-case)
[ShareThis shareURL:title:image:withService:onViewController:];
Remember that to use Pocket and Readability, you must pass in the api key when starting ShareThis session in application:didFinishLaunchingWithOptions.
[ShareThis showShareOptionsToShareUrl:title:image:onViewController:];
[ShareThis showShareOptionsToShareUrl:title:image:onViewController:forTypeOfContent:];
STContentTypeArticle will include the read later services while STContentTypeVideo will not.
ShareThis is available under the MIT license. See the LICENSE file for more info.