Latest 1.0.0
Homepage https://github.com/ign/ShareThis
License BSD
Platforms ios 5.0, requires ARC
Dependencies Facebook-iOS-SDK, REComposeViewController, cocoa-oauth
Frameworks Security, QuartzCore, MessageUI, Twitter, CoreGraphics, Social*, Accounts*, AdSupport*
Authors , , ,

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.

iOS 6+:

ShareThis
ShareThis

iOS 5:

ShareThis
ShareThis

Installation Instruction:

In AppDelegate.m:

Import ShareThis.h

import "ShareThis.h"

In application:didFinishLaunchingWithOptions add:

[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.

In applicationDidBecomeActive add:

[[NSNotificationCenter defaultCenter] postNotificationName:AppDidBecomeActiveNotificationName object:nil];

In applicationWillTerminate add:

[[NSNotificationCenter defaultCenter] postNotificationName:AppWillTerminateNotificationName object:nil];

Add in method application:openURL:sourceApplication:annotation

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [ShareThis handleFacebookOpenUrl:url]; }

In app’s .plist file add:

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)

Using ShareThis:

To share with a specific service:

[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.

To show a share option:

[ShareThis showShareOptionsToShareUrl:title:image:onViewController:];

To show a share option for a type of content:

[ShareThis showShareOptionsToShareUrl:title:image:onViewController:forTypeOfContent:];

STContentTypeArticle will include the read later services while STContentTypeVideo will not.

License

ShareThis is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ShareThis",
    "version": "1.0.0",
    "platforms": {
        "ios": "5.0"
    },
    "license": {
        "type": "BSD"
    },
    "summary": "An iOS sharing tool that can be easily inserted into a project.",
    "homepage": "https://github.com/ign/ShareThis",
    "authors": {
        "Aung Thar": "[email protected]",
        "Grant Bartone": "[email protected]",
        "Alex Ivlev": "[email protected]",
        "Brad Taylor": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ign/ShareThis.git",
        "tag": "1.0.0"
    },
    "description": "A sharing controller that allows anyone to implement sharing into their projects easily. iOS 5 will use action sheets and iOS 6 will use the new activity view controller. Readability, Pocket, and Instapaper are added also for read-later services to share with articles.",
    "source_files": [
        "Code/*.{h,m}",
        "Code/KeyChainItemWrapper/*.{h,m}"
    ],
    "resources": "Assets/*.png",
    "dependencies": {
        "Facebook-iOS-SDK": [
            "3.1.1"
        ],
        "REComposeViewController": [
            "0.0.1"
        ],
        "cocoa-oauth": [
            "0.0.1"
        ]
    },
    "frameworks": [
        "Security",
        "QuartzCore",
        "MessageUI",
        "Twitter",
        "CoreGraphics"
    ],
    "weak_frameworks": [
        "Social",
        "Accounts",
        "AdSupport"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This