Adyen/adyen-networking-ios
[](https://github.com/Adyen/adyen-networking-ios/actions/workflows/unit-tests.yml)
Requirements
- iOS 12.0+
- Xcode 12.0+
- Swift 5.3
Installation
Adyen Networking for iOS are available through either CocoaPods, Carthage or Swift Package Manager.
CocoaPods
- Add
pod 'AdyenNetworking'to yourPodfile. - Run
pod install.
Carthage
- Add
github "adyen/adyen-networking-ios"to yourCartfile. - Run
carthage update. - Link the framework with your target as described in Carthage Readme.
Swift Package Manager
- Follow Apple's [Adding Package Dependencies to Your App](
https://developer.apple.com/documentation/xcode/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.
Usage
- 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.
:warning: Please make sure to retain the APIClient instance, otherwise the completion handler will not be called.
Testing
Running End-to-End Tests
Our EndToEndTests interact with the gorest.co.in API and require bearer authentication.
To run these tests locally:
- Generate a Token: Obtain your personal bearer token from gorest.co.in.
- Create DevSecrets.xcconfig: In the root directory of this project, create a new file named DevSecrets.xcconfig.
- Add Your Token: Copy the content from DevSecrets.xcconfig.template into your new DevSecrets.xcconfig file. Replace the placeholder token with the actual bearer token you generated.
Support
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
Contributing
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.
License
This repository is open source and available under the MIT license. For more information, see the LICENSE file.
Package Metadata
Repository: Adyen/adyen-networking-ios
Stars: 7
Forks: 5
Open issues: 6
Default branch: develop
Primary language: swift
License: MIT
README: README.md