2.1. iOS Intro - Aigul-Irgalina/personal_test GitHub Wiki
Intro
Unlimint mobile SDK helps you to implement payments in your application. Release 1.8 version supports following methods:
- binding card for further recurring payments,
- checking which payment methods are available for you,
- payment with new bank card,
- payment with saved bank card (token),
- payment with PayPal.
Unlimint SDK has two parts: SDK UI and SDK Core. SDK UI already contains SDK Core. The former has user interface, root detection and simplified API. It securely collects and transmits user card data. The latter has only payment methods. We strongly recommend to use SDK UI if you don't have PCI DSS certificate.
Installation
Unlimint mobile SDK is available through CocoaPods.
To install Unlimint SDK UI with CocoaPods, add the following lines to your Podfile:
source 'https://github.com/cardpay/ios-sdk-podspec.git'
platform :ios, '11.0'
use_frameworks!
pod 'UnlimintSDK-UI'
unlimintXCFramework = ['Alamofire', 'Moya', 'Swinject', 'UnlimintSDK-Core']
post_install do |installer|
installer.pods_project.targets.each do |target|
if unlimintXCFramework.include? "#{target}"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
To install Unlimint SDK Core with CocoaPods, add the following lines to your Podfile:
source 'https://github.com/cardpay/ios-sdk-podspec.git'
platform :ios, '11.0'
use_frameworks!
pod 'UnlimintSDK-Core'
unlimintXCFramework = ['Alamofire', 'Moya']
post_install do |installer|
installer.pods_project.targets.each do |target|
if unlimintXCFramework.include? "#{target}"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
Then run pod install command. For details of installation and usage of CocoaPods, visit its official website.
Basic Usage
Environment
# For Unlimint SDK UI
Unlimint.shared.environment = .sandbox
# For Unlimint SDK Core
Environments.current = .sandbox
UI Customization
Find more details in [UI Customization](link to github).
'Unlimint.shared.theme'
public struct Theme {
public var navigationStyle: NavigationBarStyle
public var mainButtonStyle: MainButtonStyle
public var viewControllerStyle: ViewControllerStyle
public init(navigationStyle: NavigationBarStyle = .init(bar: .largeNavBar,
statusBarStyle: .default,
navigationBarColor: .transparentDark,
tintColor: .clear),
mainButtonStyle: MainButtonStyle = .init(cornerRadius: 2,
titleColor: (UIConstants.Colors.primaryBlack,
UIConstants.Colors.primaryGray),
backgroundColor: (UIConstants.Colors.primaryGreen,
UIConstants.Colors.primaryWhite)),
viewControllerStyle: ViewControllerStyle = .init(backgroundColor: .white))
}