A client library that implements the complete FestivalsAPI feature set and makes coding against it super easy.
Development • Usage • Installation • Engage
The FestivalsAPI client library is tightly coupled with the festivals-server which provides the implementation of the FestivalsAPI and is also coupled with the festivals-identity-server which provides means to authenticate and authorize against the FestivalsAPI. To find out more about the architecture and technical information see the ARCHITECTURE document. The general documentation for the Festivals App is in the festivals-documentation repository. The documentation repository contains architecture information, general deployment documentation, templates and other helpful documents.
The client library is the optimal starting point to implement new FestivalsApp behaviour.
- Xcode Version 15.2+
- jazzy 0.14.4+ for building the documentation
- bartycrouch 4.15.0+ for string localization
There is an ExampleApp for developing and testing.
The unit tests are implemented via the XCTest framework. To run the tests successfully you need to provide a valid address to a testable FestivalsAPI instance in the Info.plist under the FestivalsAPI_URL
key. To setup the FestivalsAPI see the festivals-server repository. At the moment the tests are run manually, i want to run the tests automated but i need to decided on the automation/CI which should be used.
The library consists of the FestivalsClient
class, the handler classes and their corresponding objects.
- Objects: Festival, Event, Artist, Location, ImageRef, Link, Place, Tag
- Handler: FestivalHandler, EventHandler, ArtistHandler, LocationHandler, ImageRefHandler, LinkHandler, PlaceHandler and TagHandler
To use this library, create an FestivalsClient
object by calling the init(baseURL:clientAuth:)
function. The client object provides you with a handler for each object type provided by the FestivalsAPI, through which you can fetch, create and delete those objects.
// Create the handler
let certificates = CertificateProvider(certData: <#certData#>, certPassword: <#Password#>, rootCAData: <#caData#>) {
let clientAuth = ClientAuth(apiKey:<#apiKey#>, certificates: certificates)
or
let userAuth = UserAuth(jwt: <#jwt#>, apiKey:<#apiKey#>, certificates: certificates)
let client = FestivalsClient(baseURL: <#baseURL#>, clientAuth: <#user or client auth#>)
// fetch all festivals
client.festivalHandler.all { (festivals, err) in
guard let festivals = festivals else {
print(err)
return
}
// use festivals
}
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding FestivalsAPI as a dependency is as easy as adding it to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/Festivals-App/festivals-api-ios.git", .upToNextMajor(from: "0.3"))
]
I welcome every contribution, whether it is a pull request or a fixed typo. The best place to discuss questions and suggestions regarding the FestivalsAPI iOS client library is the projects issues section. More general information and a good starting point if you want to get involved is the festival-documentation repository.
The following channels are available for discussions, feedback, and support requests:
Type | Channel |
---|---|
General Discussion | |
Other Requests |
Copyright (c) 2020-2024 Simon Gaus. Licensed under the GNU Lesser General Public License v3.0