{"id":28000591,"url":"https://github.com/star-micronics/starxpand-sdk-ios","last_synced_at":"2025-05-08T23:53:43.771Z","repository":{"id":37441146,"uuid":"451411581","full_name":"star-micronics/StarXpand-SDK-iOS","owner":"star-micronics","description":"StarXpand SDK for iOS is a software development kit for supporting application development for Star Micronics devices.","archived":false,"fork":false,"pushed_at":"2024-11-19T05:31:31.000Z","size":38505,"stargazers_count":30,"open_issues_count":2,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-08T23:53:37.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://star-m.jp/starxpandsdk-oml.html","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/star-micronics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T10:09:01.000Z","updated_at":"2025-05-01T02:47:25.000Z","dependencies_parsed_at":"2024-11-19T06:36:55.513Z","dependency_job_id":null,"html_url":"https://github.com/star-micronics/StarXpand-SDK-iOS","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/star-micronics%2FStarXpand-SDK-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/star-micronics%2FStarXpand-SDK-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/star-micronics%2FStarXpand-SDK-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/star-micronics%2FStarXpand-SDK-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/star-micronics","download_url":"https://codeload.github.com/star-micronics/StarXpand-SDK-iOS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166486,"owners_count":21864471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-08T23:53:43.122Z","updated_at":"2025-05-08T23:53:43.763Z","avatar_url":"https://github.com/star-micronics.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg\n    src=\"docs/logo.png\"\n    width=\"600\"\n    style=\"margin-top: 20px; margin-bottom: 20px;\"\n  /\u003e\n\u003c/div\u003e\n\n- [日本語はこちら](docs/README_JP.md)\n\n# StarXpand SDK for iOS\n\n`StarXpand SDK for iOS` is a software development kit for supporting application development for Star Micronics devices.\n\nThis software development kit provides the StarIO10 framework (StarIO10.xcframework) as a framework to control the Star Micronics devices.\n\nIn accordance with Apple's guidelines, StarIO10 V2.6.1 or later includes a privacy manifest file. Please see [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files) for the Manifest file.\nHowever, StarIO10 does not use the Required Reason API from the first release. (As of January 29, 2024)\n\n## Documentation\n\nPlease refer [here](https://www.star-m.jp/starxpandsdk-oml.html) for StarXpand SDK documentation.\n\nDocumentation includes an overview of the SDK, how to build a sample application, how to use the API, and a API reference.\n\n## Requirements\n\n| Language | Language Version | Platform | OS Version | Arch |\n| --- | --- | --- | --- | --- |\n| Swift | 5 | iOS | iOS 13.0 or later | Device: arm64\u003cbr\u003e Simulator: arm64, x86_64 |\n\n## Installation\n\n### 1. Add the StarIO10 framework to your project\n\nIn order to integrate the StarIO10 framework into your iOS application, Use Swift Package Manager.\n\n1. In Xcode, select `File` menu \u003e `Add Packages...`.\n2. Enter `https://github.com/star-micronics/StarXpand-SDK-iOS` in the URL input field.\n3. Select `StarXpand-SDK-iOS` and press `Add Package` button.\n\nFor more information on how to integrate Swift Package, please refer to the following URL.\n\nhttps://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app\n\n### 2. Preliminary Procedures\n\nSome settings and approvals are required depending on the printer interface.  \nPlease check the table below and take action.\n\n| Interface of the printer  | Necessary actions                                                                       |\n|---------------------------|-----------------------------------------------------------------------------------------|\n| Bluetooth                 | [2.1.](#SupportedEAProtocols) \u0026 [2.2.](#BluetoothAlwaysUsageDescription) \u0026 [2.4.](#MFi) |\n| Bluetooth Low Energy      | [2.2.](#BluetoothAlwaysUsageDescription)                                                |\n| Ethernet (iOS14 or later) | [2.3.](#LocalNetworkUsageDescription)                                                   |\n| Lightning USB             | [2.1.](#SupportedEAProtocols) \u0026 [2.4.](#MFi)                                            |\n\n\u003ca id=\"SupportedEAProtocols\"\u003e\u003c/a\u003e\n#### 2.1. Set `Supported external accessory protocols` \n\n1. Click on the information property list file (default : “Info.plist\").\n2. Add the `Supported external accessory protocols` Key.\n3. Click the triangle of this key and set the value for the “Item 0\" to `jp.star-m.starpro`.\n\n\u003e :warning: If you do not use the printer concerned, do not configure this setting.\n\n\u003ca id=\"BluetoothAlwaysUsageDescription\"\u003e\u003c/a\u003e\n#### 2.2. Set `Bluetooth Always Usage Description` and `Bluetooth Peripheral Usage Description`\n\n1. Click on the information property list file (default : “Info.plist\").\n2. Add the `Privacy - Bluetooth Always Usage Description` Key.\n3. If you set `Deployment Target` to iOS12, add the `Privacy - Bluetooth Peripheral Usage Description` Key.\n4. Set the reason for using Bluetooth in Value (e.g. `Use Bluetooth for communication with the printer.`)\n5. When communicating with the Bluetooth printer on iOS 13 or later, an alert requesting permission to access Bluetooth is displayed. The string set in Value is displayed in the alert as the reason for using Bluetooth.\n\nFor more information, please refer to the following URL.\n\nhttps://developer.apple.com/documentation/bundleresources/information_property_list/nsbluetoothperipheralusagedescription\n\n\u003ca id=\"LocalNetworkUsageDescription\"\u003e\u003c/a\u003e\n#### 2.3. Set `Local Network Usage Description`\n\n1. Click on the information property list file (default : “Info.plist\").\n2. Add the `Privacy - Local Network Usage Description` Key.\n3. Set the reason for using Local Network in Value (e.g. `Use Local Network for communication with the printer or discovery the printers.`)\n4. When communicating with the Ethernet printer on iOS 14 or later, an alert requesting permission to access Local Network is displayed. The string set in Value is displayed in the alert as the reason for using Local Network.\n\n\u003ca id=\"MFi\"\u003e\u003c/a\u003e\n#### 2.4. Apple Approval Process for STAR MFi Applications\n\nIn order to offer your application that communicates a MFi certified printer on the Apple iTunes App Store, your application needs to be approved by the Apple MFi program before you submit it to the Apple iTunes App Store. Please follow the steps described in the URL below to obtain the app approval. This procedure must be completed before the app is reviewed by Apple.\n\nhttps://star-m.jp/eng/products/s_print/apple_app_mfi.html\n\n\u003e :warning: In case of a Bluetooth Low Energy printer, you do not need to obtain this app approval.\n\n## Examples\n\nStarXpand SDK includes an [example](example) application that can be used in combination with the printer to check its operation. Please use it in conjunction with the explanations of each function in the linked pages.\n\n#### 1. [Discover printers](https://star-m.jp/products/s_print/sdk/starxpand/manual/en/searchPrinter.html)\n\n#### 2. [Create printing data](https://star-m.jp/products/s_print/sdk/starxpand/manual/en/basic-step1.html)\n\nThe sample code and printed result images are also [available here](example/StarXpandSDK/PrintingSamples/README.md).\n\n- Sample to create print layouts for receipts and labels for each type of business\n- Sample to generate receipt images from text data\n\n\u003e :warning: Some printer models may not be able to print some samples. Please adjust the layout accordingly when using this samples.\n\n#### 3. [Create printing data using template printing function](https://star-m.jp/products/s_print/sdk/starxpand/manual/en/template-step1.html)\n\n#### 4. [Send printing data](https://star-m.jp/products/s_print/sdk/starxpand/manual/en/basic-step2.html)\n\n#### 5. [Send printing data using spooler function](https://star-m.jp/products/s_print/sdk/starxpand/manual/en/spooler.html)\n\n#### 6. [Get printer status](#GetPrinterStatus)\n\n#### 7. [Monitor printer](#MonitorPrinter)\n\n\u003ca id=\"GetPrinterStatus\"\u003e\u003c/a\u003e\n### Get printer status\n```swift\nfunc getStatus() {\n    // Specify your printer connection settings.\n    let starConnectionSettings = StarConnectionSettings(interfaceType: .lan,\n                                                        identifier: \"00:11:62:00:00:00\")\n    \n    let printer = StarPrinter(starConnectionSettings)\n    \n    Task {\n        do {\n            // Connect to the printer.\n            try await printer.open()\n            defer {\n                Task {\n                    // Disconnect from the printer.\n                    await printer.close()\n                }\n            }\n\n            // Get printer status.\n            let status = try await printer.getStatus()\n            print(status)\n        } catch let error {\n            // Error.\n            print(error)\n        }\n    }\n}\n```\n\n\u003ca id=\"MonitorPrinter\"\u003e\u003c/a\u003e\n### Monitor printer\n```swift\nvar printer: StarPrinter?\n\nfunc monitor() async {\n    // Specify your printer connection settings.\n    let settings = StarConnectionSettings(interfaceType: .lan,\n                                          identifier: \"00:11:62:00:00:00\")\n    printer = StarPrinter(settings)\n    \n    guard let printer = printer else {\n        return\n    }\n    \n    printer.printerDelegate = self\n    printer.drawerDelegate = self\n    printer.inputDeviceDelegate = self\n    printer.displayDelegate = self\n    \n    Task {\n        do {\n            // Connect to the printer.\n            try await printer.open()\n        } catch let error {\n            // Error.\n            print(error)\n        }\n    }\n}\n\n// Callback for printer state changed.\n\nfunc printerIsReady(_ printer: StarPrinter) {\n    print(\"Printer: Ready\")\n}\n\nfunc drawer(printer: StarPrinter, didSwitch openCloseSignal: Bool) {\n    print(\"Drawer: Open Close Signal Switched: \\(openCloseSignal)\")\n}\n\nfunc inputDevice(printer: StarPrinter, didReceive data: Data) {\n    print(\"Input Device: DataReceived \\(NSData(data: data))\")\n}\n\nfunc displayDidConnect(printer: StarPrinter) {\n    print(\"Display: Connected\")\n}\n\n// ...\n// Please refer to document for other callback.\n```\n\n## Copyright\n\nCopyright 2022 Star Micronics Co., Ltd. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstar-micronics%2Fstarxpand-sdk-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstar-micronics%2Fstarxpand-sdk-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstar-micronics%2Fstarxpand-sdk-ios/lists"}