Code Monkey home page Code Monkey logo

openapi-objectivec's Introduction

KKBOX Open API Developer SDK for iOS/macOS/watchOS/tvOS

Copyright © 2016-2020 KKBOX Technologies Limited

Actions Status  build  License Apache  CocoaPods  Support  Support  Support  Support 

About

The SDK helps to access KKBOX's Open API. You can easily add the SDK to your Xcode project, and start an app powered by KKBOX. You may obtain information about song tracks, albums, artists and playlists as well.

The SDK is developed in Objective-C programing language, but you can still bridge the SDK to your Swift code. You can use the SDK on various Apple platforms such as iOS, macOS, watchOS and tvOS.

If you are looking for a pure Swift SDK, please take a look at KKBOX Open API Swift SDK.

For further information, please visit KKBOX Developer Site.

Requirement

The SDK supports

  • 📱 iOS 7.x or above
  • 💻 Mac OS X 10.9 or above
  • ⌚️ watchOS 2.x or above
  • 📺 tvOS 9.x or above

Build ⚒

You need the latest Xcode and macOS. Xcode 10 and macOS 10.14 Mojave are recommended.

Installation

Swift Package Manager

You can install the library via Swift Package Manager (SPM). Just add the following lines to your Package.swift file.

dependencies: [
    .package(url: "https://github.com/KKBOX/OpenAPI-ObjectiveC.git", from: "1.3.1"),
],

Then run swift build.

Or, you can use the "Add Package Dependency" command under the "Swift Packages" menu in Xcode 11.

CocoaPods

The SDK supports CocoaPods. Please add pod 'KKBOXOpenAPI' to your Podfile, and then call pod install.

Usage

To start using the SDK, you need to create an instance of KKBOXOpenAPI.

let API = KKBOXOpenAPI(clientID: "YOUR_CLIENT_ID", secret: "YOUR_CLIENT_SECRET")

Then, ask the instance to fetch an access token by passing a client credential.

API.fetchAccessTokenByClientCredential { token, error in ... }

Finally, you can start to do the API calls. For example, you can fetch the details of a song track by calling 'fetchTrack'.

self.API.fetchTrack(withTrackID: trackID, territory: .taiwan) { track, error in ... }

You can develop your app using the SDK with Swift or Objective-C programming language, although we have only Swift sample code here.

The project contains a demo project. Please open KKBOXOpenAPI.xcodeproj located in the "ExampleIOS" folder with Xcode and give it a try.

API Documentation 📖

License

Copyright 2016-2020 KKBOX Technologies Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

openapi-objectivec's People

Contributors

zonble avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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