2. How to add the library
2.1. Adding the library to project
Library supports CocoaPods and Framework.Please link library that suits your application configuration.
Please download and confirm the newest SDK and Library from our Global Support Site.
2.1.1. Using CocoaPods
Insert following code in Podfile.
pod 'StarIO', 'StarIOVersion' pod 'StarIO_Extension', 'StarIOExtensionVersion' pod 'StarIODeviceSetting', 'StarIODeviceSettingVersion'
Note
Please refer to Podfile in SDK for the latest library version.
And then run
pod install
2.1.2. Manually adding the link
Add StarIO.xcframework to “Link Binary With Libraries” on the Build Phases tab.
Add StarIO_Extension.xcframework to “Link Binary With Libraries” on the Build Phases tab.
Add StarIODeviceSetting.xcframework to “Link Binary With Libraries” on the Build Phases tab.
Set “Embed” on “Frameworks, Libraries, and Embedded Content” on the General tab as shown below.
StarPRNT SDK Version |
StarIO |
StarIO_Extension |
StarIODeviceSetting |
V5.17.1 or later |
Embed & Sign |
Embed & Sign |
Embed & Sign |
V5.16.0 - V5.17.0 |
Embed & Sign |
Embed & Sign |
Do Not Embed |
V5.15.1 or earlier |
Do Not Embed |
Do Not Embed |
Do Not Embed |
Add following frameworks to Project.
CoreBluetooth.framework
ExternalAccessory.framework
Note
If using a StarIODeviceSetting.xcframework, add also a StarIO.xcframework to “Link Binary With Libraries”.
2.2. Edit information property list.
2.2.1. Set Supported external accessory protocols
When using Bluetooth printer
Warning
Please do not apply this, if you are not using Bluetooth ineterface.
Click on the information property list file (default : “Info.plist”).
Add the
Supported external accessory protocols
Key.Click the triangle of this key and set the value for the “Item 0” to
jp.star-m.starpro
.
2.2.2. Set Bluetooth Always Usage Description
When using Bluetooth Low Energy printer on iOS13 or later
Click on the information property list file (default : “Info.plist”).
Add the
Privacy – Bluetooth Always Usage Description
Key.Set the reason for using Bluetooth in Value (e.g.
Use Bluetooth for communication with the printer.
)When communicating with the Bluetooth Low Energy printer on iOS13 or higher, 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.

2.2.3. Set Local Network Usage Description
When using Ethernet printer on iOS14 or later
Click on the information property list file (default : “Info.plist”).
Add the
Privacy - Local Network Usage Description
Key.Set the reason for using Local Network in Value (e.g.
Use Local Network for communication with the printer or discovery the printers.
)When communicating with the Ethernet printer on iOS14 or higher, 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.

2.3. Add Objective-C Bridging Header
Development with Swift
Frameworks included in the iOS StarPRNT SDK are written in Objective-C. To use them in Swift, you need to add Objective-C Bridging-Header to your project.
Select File – New – File… from Xcode menu.
Select the Header File , and then click Next .
Enter a name and click Create to create an empty header file. In the example shown below, the header file name is “StarIO_Extension-Bridging-Header.h”.
Write the following import lines in the header file created.
#import <StarIO/SMPortSwift.h> #import <StarIO_Extension/StarIoExt.h> #import <StarIO_Extension/StarIoExtManager.h> #import <StarIO_Extension/SMBluetoothManagerFactory.h> #import <StarIO_Extension/SMSoundSetting.h> // To use StarIODeviceSetting.xcframework, you also need to write the following lines. #import <StarIODeviceSetting/StarIODeviceSetting.h>
Specify the path to the created header file at Objective-C Bridging Header of Build Settings.

Then, you can use frameworks in Swift.