{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-ios/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-walkthrough","step","admonition"]},"type":"markdown"},"seo":{"title":"Installation & Initialization | iOS Card Present SDK Reference","description":"Add the Finix PAX MPOS SDK to your iOS project via Swift Package Manager, configure Bluetooth permissions, and initialize the SDK.","siteUrl":"https://docs.finix.com/","llmstxt":{"hide":false,"sections":[{"title":"Getting Started","includeFiles":["guides/getting-started/**/*.md"],"excludeFiles":[]},{"title":"Online Payments","includeFiles":["guides/online-payments/**/*.md"],"excludeFiles":["guides/online-payments/payment-features/fsa-hsa-non-healthcare-mcc.md"]},{"title":"In-Person Payments","includeFiles":["guides/in-person-payments/**/*.md"],"excludeFiles":[]},{"title":"Subscriptions","includeFiles":["guides/subscriptions/**/*.md"],"excludeFiles":[]},{"title":"After the Payment","includeFiles":["guides/after-the-payment/**/*.md"],"excludeFiles":[]},{"title":"Managing Operations","includeFiles":["guides/managing-operations/**/*.md"],"excludeFiles":[]},{"title":"Platform Payments","includeFiles":["guides/platform-payments/**/*.md"],"excludeFiles":[]},{"title":"Payouts","includeFiles":["guides/payouts/**/*.md"],"excludeFiles":[]},{"title":"Low-Code / No-Code","includeFiles":["low-code-no-code/**/*.md"],"excludeFiles":[]},{"title":"Developers","includeFiles":["additional-resources/developers/**/*.md"],"excludeFiles":[]},{"title":"Plugins","includeFiles":["additional-resources/plugins/**/*.md"],"excludeFiles":[]},{"title":"Industry Considerations","includeFiles":["guides/industry-considerations/**/*.md"],"excludeFiles":[]},{"title":"Regional Considerations","includeFiles":["guides/regional-considerations/**/*.md"],"excludeFiles":[]},{"title":"Release Notes","includeFiles":["release-notes/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{},"filesets":[{"files":[{"path":"ios/card-present/_filesets/installation.swift","content":[{"start":0,"condition":{"steps":["add-package"]},"children":["// Swift Package Manager — add via Xcode:","// File → Add Package Dependencies","// https://github.com/finix-payments/finix-pax-mpos-ios-sdk","import PaxMposSDK"]},"",{"start":7,"condition":{"steps":["add-permission"]},"children":["// Info.plist","// NSBluetoothAlwaysUsageDescription: \"This app uses Bluetooth to communicate with your payment device.\""]},"",{"start":12,"condition":{"steps":["initialize"]},"children":["import PaxMposSDK","","let finixClient = FinixClient(config: FinixConfig(","    environment: .Sandbox, // use .Production for live payments","    credentials: Finix.APICredentials(username: \"USxxxxxxxxx\", password: \"your_api_secret\"),","    merchantId: \"MUxxxxxx\",","    mid: \"\",","    deviceType: .Pax,","    deviceId: \"\" // updated after device discovery","))","finixClient.delegate = self","finixClient.interactionDelegate = self"]},"",{"start":27,"condition":{"steps":["scan"]},"children":["finixClient.startScan()","","extension PaymentViewController: FinixDelegate {","    func didDiscoverDevice(_ deviceInfo: DeviceInfo) {","        // deviceInfo.id is the Bluetooth identifier — pass it to connectDevice","        finixClient.connectDevice(deviceInfo.id)","    }","}"]},"",{"start":38,"condition":{"steps":["connect"]},"children":["extension PaymentViewController: FinixDelegate {","    func deviceDidConnect(_ deviceInfo: DeviceInfo) {","        // Update the client with the connected device's ID before transacting","        finixClient.update(deviceId: deviceInfo.id)","        // device is now ready for transactions","    }","}"]},""],"metadata":{"steps":["add-package","add-permission","initialize","scan","connect"]},"basename":"installation.swift","language":"swift"}],"downloadAssociatedFiles":[]}],"steps":[{"id":"add-package","heading":"Add the package"},{"id":"add-permission","heading":"Add Bluetooth permission"},{"id":"initialize","heading":"Initialize the SDK"},{"id":"scan","heading":"Scan for devices"},{"id":"register","heading":"Register the device"},{"id":"connect","heading":"Connect to a device"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"installation--initialization","__idx":0},"children":["Installation & Initialization"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"add-package","heading":"Add the package"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the SDK to your Xcode project via Swift Package Manager. In Xcode, go to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["File → Add Package Dependencies"]}," and enter the repository URL:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"https://github.com/finix-payments/finix-pax-mpos-ios-sdk\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Physical device required"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK requires a physical iOS device. The simulator is not supported."]}]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"add-permission","heading":"Add Bluetooth permission"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the following key to your app's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Info.plist"]},". Without it, the OS will not grant access to Bluetooth and scanning will fail."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<key>NSBluetoothAlwaysUsageDescription</key>\n<string>This app uses Bluetooth to communicate with your payment device.</string>\n","lang":"xml"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initialization","__idx":1},"children":["Initialization"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"initialize","heading":"Initialize the SDK"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FinixClient"]}," instance with your ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/ios/card-present/credentials"},"children":["credentials"]},". Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceId"]}," to an empty string on first initialization — you will update it after device discovery."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"scan-for-devices","__idx":2},"children":["Scan for devices"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"scan","heading":"Scan for devices"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startScan()"]}," to begin scanning for nearby PAX D135 devices over Bluetooth. Each discovered device is reported via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FinixDelegate"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Delegate Method"},"children":["Delegate Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Trigger"},"children":["Trigger"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["didDiscoverDevice(_ deviceInfo: DeviceInfo)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called each time a nearby device is found. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceInfo.id"]}," is the Bluetooth identifier."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Bluetooth permission prompt"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When running for the first time, the OS will show a Bluetooth permission dialog. If the user dismisses the device list before granting access, have them dismiss and re-open the scanner after tapping Allow."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"register-the-device","__idx":3},"children":["Register the device"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"register","heading":"Register the device"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you haven't already created and activated the device in Finix, do so now before connecting. Use the serial number printed on the PAX D135 (or the one surfaced in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["didDiscoverDevice"]},")."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]}," — POST to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/merchants/{merchant_id}/devices"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"model\": \"PAX_D135\""]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"serial_number\""]},". Copy the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," from the response — this is your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceId"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Activate"]}," — PUT to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/devices/{device_id}"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"action\": \"ACTIVATE\""]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/ios/card-present/device-setup"},"children":["Device Setup"]}," for the full API calls and Dashboard alternative."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"connect-to-a-device","__idx":4},"children":["Connect to a device"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"connect","heading":"Connect to a device"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connectDevice(_:)"]}," with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeviceInfo.id"]}," from the scan callback. The PAX D135 indicates status with its LED:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Orange light"]}," - ready for pairing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Green light"]}," - fully charged"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Green light only (after connect)"]}," - connected and ready"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Delegate Method"},"children":["Delegate Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Trigger"},"children":["Trigger"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceDidConnect(_ deviceInfo: DeviceInfo)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when the device is connected and ready to accept transactions."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceDidConnect"]},", call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["finixClient.update(deviceId:)"]}," with the connected device's ID before starting a transaction."]}]}]}]},"headings":[{"value":"Installation & Initialization","id":"installation--initialization","depth":1},{"value":"Initialization","id":"initialization","depth":2},{"value":"Scan for devices","id":"scan-for-devices","depth":2},{"value":"Register the device","id":"register-the-device","depth":2},{"value":"Connect to a device","id":"connect-to-a-device","depth":2}],"frontmatter":{"seo":{"title":"Installation & Initialization | iOS Card Present SDK Reference","description":"Add the Finix PAX MPOS SDK to your iOS project via Swift Package Manager, configure Bluetooth permissions, and initialize the SDK."},"markdown":{"toc":{"hide":true}},"footer":{"hide":true}},"lastModified":"2026-08-26T22:56:02.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ios/card-present/installation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}