Adyen Networking for iOS provides reusable and user-friendly, generic http/https API client functionalities.
- iOS 12.0+
- Xcode 12.0+
- Swift 5.3
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-iosas the repository URL. - Specify the version to be at least
1.0.0.
- Create a
class/structthat conforms toAnyAPIContext, to define the API that you're going to call. - Create a
class/structthat conforms toRequestprotocol and another one conforming to the correspondingResponseprotocol for each endpoint you want to call from the API you defined in step 1. - Create an instance of
APIClientor one of the other convenienceAPIClientProtocolimplementations, 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.
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: support@adyen.com
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.