Git Product home page Git Product logo

sharethis's Introduction

ShareThis

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+:

####iOS 5:

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

sharethis's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.