Allihoopa-macOS

SDK to drop and import pieces to and from Allihoopa.


License
MIT
Install
pod try Allihoopa-macOS

Documentation

Allihoopa SDK for macOS

Travis Carthage compatible


An Objective-C/Swift SDK to interface with Allihoopa from macOS. If you're working on an iOS app, check out our iOS SDK!

What can I do with the Allihoopa SDK?

The Allihoopa service brings all of us, everyone, together for a free and open exchange of music pieces and ideas, all united in "doing music" just for the sake of it.

With our SDK, you can fully integrate your app into the Allihoopa ecosystem. Your users can "Pick Up" pieces from Allihoopa and use them in their own music, and "Drop" their music directly from your app to Allihoopa for others to enjoy. Since Allihoopa allows both audio renders and your own document data to be attached to pieces, your app's users can fully collaborate with one another with ease.


The Alliihoopa SDK "Browse" flow in the iOS and macOS SDKs.

Want to get on board? Great! You'll need to register your application with us to get an app identifier for our APIs. Email us at developer@allihoopa.com with some details about your app and we'll get you set up.

Installation

There are different ways of installing the Allihoopa SDK depending on your project's setup.

If you use Carthage, you can add this SDK to your Cartfile:

github "Allihoopa/Allihoopa-macOS" ~> 3.0.0

After this, you run carthage to build the framework, and then drag the resulting build results into your project:

  • Allihoopa.framework from the Carthage/Build folder
  • AllihoopaCore.framework from the Carthage/Build/Mac folder

Alternatively, you can simply download the latest framework builds from the Releases tab.

Manual build

If you want, you can include the Allihoopa-macOS project as a sub-project to your application and build the framework as a dependency. In this case, you will need to include AllihoopaCore-ObjC too as a dependency since this project share a lot of code and functionality with the iOS SDK.

If you use Carthage, these dependencies are managed automatically for you.

SDK Usage and Code Samples

Project Configuration

You need to add a URL scheme to your app's Info.plist: ah-{APP_IDENTIFIER}, e.g. ah-figure if your application identifier is figure. You will receive your application identifier and API key when your register your application with Allihoopa. Email us at developer@allihoopa.com with some details about your app and we'll get you set up.

First Steps

You need a class, e.g. your app delegate, to implement the AHAAllihoopaSDKDelegate to support the "open in" feature. See below how to implement this feature.

import Allihoopa

// In your UIApplicationDelegate implementation
func applicationDidFinishLaunching(_ aNotification: Notification) {
    AHAAllihoopaSDK.shared().setup([
        .applicationIdentifier: "your-application-identifier",
        .apiKey: "your-api-key",
        .delegate: self,
    ])
}
#import <Allihoopa/Allihoopa.h>

// In your UIApplicationDelegate implementation
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
    [[AHAAllihoopaSDK sharedInstance] setupWithConfiguration:@{
        AHAConfigKeyApplicationIdentifier: @"your-application-identifier",
        AHAConfigKeyAPIKey: @"your-api-key",
        AHAConfigKeySDKDelegate: self,
    }];
}

setupWithConfiguration: must be called before any other API calls can be made. It will throw an exception if the SDK is improperly setup: if the credentials are missing or if you've not set up the URL scheme properly.

The configuration dictionary supports the following keys - names in Objective-C vs. Swift:

  • AHAConfigKeyApplicationIdentifier/.applicationIdentifier: required string containing the application identifier provided by Allihoopa.
  • AHAConfigKeyAPIKey/.apiKey: required string containing the app's API key.
  • AHAConfigKeySDKDelegate/.sdkDelegate: optional instance used to notify the application when a user tries to import a piece into this app. If provided, the instance must conform to the AHAAllihoopaSDKDelegate protocol.
  • AHAConfigKeyRegisterURLEventHandler/.registerURLEventHandler: optional boolean indicating whether the SDK should register its own URL opener handler. For convenience, this defaults to true and thus must be set to false if you want your own URL event handler. If you set this to false, you must call -handleOpenURL:(NSURL*)/handleOpen(url) in your own event handler.

Next Steps

Look in the SDKExample folder for hands-on code samples and instructions on how to work with our SDK. Additionally, you can find more advanced code samples and discussion on working with the more advanced parts of the SDK over in our Advanced Usage documentation.

Getting ready for release?

When you’re getting close to releasing your app, we would like you to go over this pre-release checklist to verify that you’ve integrated our SDK correctly.