Coder Social home page Coder Social logo

nbsoundcloudactivity's Introduction

#NBSoundCloudActivity


NBSoundCloudActivity is a simple subclass of UIActivity that allows you to post audio content to SoundCloud via the UIActivityViewController introduced in iOS 6. It wraps the SoundCloud sharing SDK to display a posting user interface and to actually send the data.

#Setup


First, clone or download the Git repository to your local disk.

The sample project uses CocoaPods to manage dependencies, so you'll need to install it and run the following command within the project root directory to get the dependent code

pod install

Now you're ready to open the sample project and run it. Make sure you open the NBSoundCloudActivity.xcworkspace in order to get the Pods dependencies. In "ViewController.m" you'll also need to set the Client ID, Client Secret, and Redirect URL for your SoundCloud account in order for the demo to work.

Once you're satisfied, you can copy the source and assets from the "NBSoundCloudActivity" group into your own project. Keep in mind you'll also need the SoundCloud SDK dependencies in your own project as well.

#Usage


Using NBSoundCloudActivity couldn't be easier. All you have to do is create an instance using your SoundCloud API Client ID and Secret and pass it along to an instance of UIActivityViewController along with an AVURLAsset object representing the audio file you'd like to share.

NSURL* sampleURL = [[NSBundle mainBundle] URLForResource:@"sample" withExtension:@"caf"];
AVURLAsset* asset = [AVURLAsset assetWithURL:sampleURL];

NBSoundCloudActivity* scActivity = [[NBSoundCloudActivity alloc] initWithClientId:kSoundCloudClientId
											secret:kSoundCloudClientSecret 
											redirectURL:[NSURL URLWithString:@"myapp://soundcloudlogin"]];

UIActivityViewController* avc = [[UIActivityViewController alloc] initWithActivityItems:@[asset]
                                                                  applicationActivities:@[scActivity]];
avc.excludedActivityTypes = @[ UIActivityTypePostToWeibo, UIActivityTypeMessage, UIActivityTypeCopyToPasteboard ];

[self presentViewController:avc animated:YES completion:nil];

iOS will present the user with a standard activity view where the user can select "SoundCloud" as an option and be brought through the standard SoundCloud sharing UI.

#Contact


##Creators This library was created and is maintained by Nick Bonatsakis.

Nick Bonatsakis

@nickbona

##Feedback Feedback via suggestions or pull requests is strongly encouraged. Please do not submit any pull requests without accompanying unit tests.

#License


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

nbsoundcloudactivity's People

Contributors

nbonatsakis avatar

Watchers

 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.