StarXpand SDK for iOS
is a software development kit for supporting application development for Star Micronics devices.
This software development kit provides the StarIO10 framework (StarIO10.xcframework) as a framework to control the Star Micronics devices.
In accordance with Apple's guidelines, StarIO10 V2.6.1 or later includes a privacy manifest file. Please see here for the Manifest file. However, StarIO10 does not use the Required Reason API from the first release. (As of January 29, 2024)
Please refer here for StarXpand SDK documentation.
Documentation includes an overview of the SDK, how to build a sample application, how to use the API, and a API reference.
Language | Language Version | Platform | OS Version | Arch |
---|---|---|---|---|
Swift | 5 | iOS | iOS 13.0 or later | Device: arm64 Simulator: arm64, x86_64 |
In order to integrate the StarIO10 framework into your iOS application, Use Swift Package Manager.
File
menu > Add Packages...
.https://github.com/star-micronics/StarXpand-SDK-iOS
in the URL input field.StarXpand-SDK-iOS
and press Add Package
button.For more information on how to integrate Swift Package, please refer to the following URL.
https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app
Some settings and approvals are required depending on the printer interface.
Please check the table below and take action.
Interface of the printer | Necessary actions |
---|---|
Bluetooth | 2.1. & 2.2. & 2.4. |
Bluetooth Low Energy | 2.2. |
Ethernet (iOS14 or later) | 2.3. |
Lightning USB | 2.1. & 2.4. |
Supported external accessory protocols
Supported external accessory protocols
Key.jp.star-m.starpro
.:warning: If you do not use the printer concerned, do not configure this setting.
Bluetooth Always Usage Description
and Bluetooth Peripheral Usage Description
Privacy - Bluetooth Always Usage Description
Key.Deployment Target
to iOS12, add the Privacy - Bluetooth Peripheral Usage Description
Key.Use Bluetooth for communication with the printer.
)For more information, please refer to the following URL.
Local Network Usage Description
Privacy - Local Network Usage Description
Key.Use Local Network for communication with the printer or discovery the printers.
)In 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.
https://star-m.jp/eng/products/s_print/apple_app_mfi.html
:warning: In case of a Bluetooth Low Energy printer, you do not need to obtain this app approval.
StarXpand SDK includes an 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.
The sample code and printed result images are also available here.
:warning: Some printer models may not be able to print some samples. Please adjust the layout accordingly when using this samples.
func getStatus() {
// Specify your printer connection settings.
let starConnectionSettings = StarConnectionSettings(interfaceType: .lan,
identifier: "00:11:62:00:00:00")
let printer = StarPrinter(starConnectionSettings)
Task {
do {
// Connect to the printer.
try await printer.open()
defer {
Task {
// Disconnect from the printer.
await printer.close()
}
}
// Get printer status.
let status = try await printer.getStatus()
print(status)
} catch let error {
// Error.
print(error)
}
}
}
var printer: StarPrinter?
func monitor() async {
// Specify your printer connection settings.
let settings = StarConnectionSettings(interfaceType: .lan,
identifier: "00:11:62:00:00:00")
printer = StarPrinter(settings)
guard let printer = printer else {
return
}
printer.printerDelegate = self
printer.drawerDelegate = self
printer.inputDeviceDelegate = self
printer.displayDelegate = self
Task {
do {
// Connect to the printer.
try await printer.open()
} catch let error {
// Error.
print(error)
}
}
}
// Callback for printer state changed.
func printerIsReady(_ printer: StarPrinter) {
print("Printer: Ready")
}
func drawer(printer: StarPrinter, didSwitch openCloseSignal: Bool) {
print("Drawer: Open Close Signal Switched: \(openCloseSignal)")
}
func inputDevice(printer: StarPrinter, didReceive data: Data) {
print("Input Device: DataReceived \(NSData(data: data))")
}
func displayDidConnect(printer: StarPrinter) {
print("Display: Connected")
}
// ...
// Please refer to document for other callback.
Copyright 2022 Star Micronics Co., Ltd. All rights reserved.