Adyen Networking for iOS provides a reusable, easy to use, generic http/https API client functionalities.
Adyen Networking for iOS are available through either CocoaPods, Carthage or Swift Package Manager.
- Add
pod 'AdyenNetworking'
to yourPodfile
. - Run
pod install
.
- Add
github "adyen/adyen-networking-ios"
to yourCartfile
. - Run
carthage update
. - Link the framework with your target as described in Carthage Readme.
- Follow Apple's Adding Package Dependencies to Your App guide on how to add a Swift Package dependency.
- Use
https://github.com/Adyen/adyen-networking-ios
as the repository URL. - Specify the version to be at least
1.0.0
.
- Create a
class/struct
that conforms toAnyAPIContext
, to define the API that you're going to call. - Create a
class/struct
that conforms toRequest
protocol and another one conforming to the correspondingResponse
protocol for each endpoint you want to call from the API you defined in step 1. - Create an instance of
APIClient
or one of the other convenienceAPIClientProtocol
implementations, and perform the request:
let apiClient = APIClient(apiContext: APIContext())
let request = GetUsersRequest()
apiClient.perform(request) { result in
switch result {
case let .success(response):
print(response)
case let .failure(error):
print(error)
}
}
Please check the Networking Demo App
folder, for some code examples.
APIClient
instance, otherwise the completion handler will not be called.
- iOS 11.0+
- Xcode 11.0+
- Swift 5.1
If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our Support Team via Customer Area or via email: [email protected]
We strongly encourage you to join us in contributing to this repository so everyone can benefit from it:
- New features and functionality
- Resolved bug fixes and issues
- Any general improvements
Read our contribution guidelines to find out how.
This repository is open source and available under the MIT license. For more information, see the LICENSE file.