Latest 1.0.1
Homepage https://github.com/nbonatsakis/NBSoundCloudActivity
License MIT
Platforms ios 6.0, requires ARC
Dependencies CocoaSoundCloudUI, CocoaSoundCloudAPI
Frameworks AVFoundation, UIKit, Foundation, CoreGraphics
Authors

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


Otherwise, 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.

Or, the preferred way to get the module into your project is to just grab the pod:

pod 'NBSoundCloudActivity', :git => 'https://github.com/nbonatsakis/NBSoundCloudActivity.git'

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.

Latest podspec

{
    "name": "NBSoundCloudActivity",
    "version": "1.0.1",
    "summary": "A UIActivity subclass for SoundCloud sharing.",
    "homepage": "https://github.com/nbonatsakis/NBSoundCloudActivity",
    "authors": {
        "Nick Bonatsakis": "[email protected]"
    },
    "license": "MIT",
    "source": {
        "git": "https://github.com/nbonatsakis/NBSoundCloudActivity.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": [
        "NBSoundCloudActivity",
        "NBSoundCloudActivity/**/NBSoundCloudActivity.{h,m}"
    ],
    "resources": "NBSoundCloudActivity/soundcloud*.png",
    "frameworks": [
        "AVFoundation",
        "UIKit",
        "Foundation",
        "CoreGraphics"
    ],
    "requires_arc": true,
    "dependencies": {
        "CocoaSoundCloudUI": [
            "~> 1.0.3"
        ],
        "CocoaSoundCloudAPI": [
            "~> 1.0.0"
        ]
    }
}

Pin It on Pinterest

Share This