iOS
On this page, we will showcase code snippets used for building and managing URI in the app for iOS.
For each response parsing case, the url should be received implementing the application method in AppDelegate. The following link comes from Apple developer documentation and shows the application method signature. https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1657379
Introduction
To check whether the Nexi POS application is installed on your device, the caller of the application needs to add the following entry to the Info.plist file.
Introduction
<key>LSApplicationQueriesSchemes</key> <array> <string>neximpos</string> </array>
Payment
Request
Request
NSURLComponents *components = [NSURLComponents componentsWithString:@"neximpos://payment"]; NSMutableArray *queryItems = [NSMutableArray new]; if (self.paymentAmountTextField.text.length) {
Response Parsing
Response Parsing
NSArray *responseParametersArray = [[responseUrl query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&"]];
Reversal
Request
Request
NSURLComponents *components = [NSURLComponents componentsWithString:@"neximpos://reversal"]; NSMutableArray *queryItems = [NSMutableArray new]; if (self.reversalAmountTextField.text.length) {
Response Parsing
Response Parsing
NSArray *responseParametersArray = [[responseUrl query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&"]]; NSMutableDictionary *responseParameterDictionary = [NSMutableDictionary dictionary];
Accounting Closure
Request
Request
NSURLComponents *components = [NSURLComponents componentsWithString:@"neximpos://accounting_closure"]; NSMutableArray *queryItems = [NSMutableArray new]; if (self.closureTransactionIdTextField.text.length) {
Response Parsing
Response Parsing
NSArray *responseParametersArray = [[responseUrl query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&"]]; NSMutableDictionary *responseParameterDictionary = [NSMutableDictionary dictionary];