Skip to main content

Veritran Docs

Integración

En este paso, debes integrar XpressPlug como una dependencia en tu proyecto de Xcode. Para ello, ejecuta el comando pod init. Luego, en el archivo Podfile, agrega el siguiente código al destino principal de tu app y guárdalo.

  1. [en] Set the necessary credentials to access XpressPlug's private repositories for iOS.

  2. [en] Integrate XpressPlug as a dependency on your Xcode project.

[en] Set Repository's Credentials

[en] Follow these steps to set your credentials for XpressPlug's private repository for iOS.

  1. [en] Create the .netrc file in the root directory (/home/:user/).

  2. [en] Add the following configuration, which will allow dependency managers such as Cocoapods to access Veritran's private resources.

    machine developer.veritran.com
    login user
    password <PRIVATE_TOKEN> 

    Importante

    [en] To obtain the private token, send an email to mobile_support@veritran.com with the "XpressPlug Access" assignment, and the team will provide you with the necessary resources.

[en] Integrate XpressPlug to your Project

[en] To configure the "podfile" and the dependencies, follow these steps:

  1. [en] Add: the following repositories at the beginning of the iOS project's podfile, within the iOS folder in its React project.

    platform :ios, '13.4'
    source 'https://developer.veritran.com/resources/xpressplug/ios/specs.git'
    source 'https://github.com/CocoaPods/Specs'  
  2. [en] Add the following lines in your podfile, that will allow library compatibility with Xcode and React-Native:

    plugin 'cocoapods-user-defined-build-types'   
    enable_user_defined_build_types!
  3. [en] In the "Pod" section, add the following XpressPlug dependency within your project's main target:

    pod 'XpressPlug', '7.10.2.51785-react', :build_type => :dynamic_framework 
  4. [en] Add the following in the Post Script section:

    post_install do |installer| 
    
        react_native_post_install(installer) 
    
        installer.pods_project.targets.each do |target| 
    
          target.build_configurations.each do |config| 
    
            if ["lottie-ios","Alamofire", "CryptoSwift", "SwiftyJSON"].include?(target.display_name) 
    
              config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' 
    
            end 
    
            if ["Alamofire"].include?(target.display_name) 
    
              config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' 
    
            end 
    
            if ["Alamofire", "lottie-ios", "SwiftyJSON", "vt_contract_resources_manager", "CryptoSwift"].include?(target.display_name) 
    
              next 
    
            end 
    
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' 
    
          end 
    
        end 
    
      end 
  5. [en] Run the following command in your terminal:

    pod install --repo-update 

    [en] After installing the dependencies, you will see the confirmation message "Pod installation complete".

  6. [en] Verify your project is compiling and running in your device. Go to Xcode, click Product > Build to install and open the app in your device.