Skip to content
bandit-ibayashi edited this page Jan 19, 2024 · 3 revisions

[All] Print text on TSP100III

Due to differences in printer capabilities, not all methods in PrinterBuilder class are available on every printer. In particular, TSP100III series does not have built-in font data, so it is limited to printing graphically and does not support actionPrintText() method.

Instead, it will be needed to build up your document as images and add them to the print job with actionPrintImage() method.

Sample code for generating images from text on React Native can be accessed below. This sample is available for iOS and Android platforms. example/samples/printing_samples/Sample15_GraphicReceipt.tsx


[All] Expo CLI

StarXpand SDK for React Native does not support Expo CLI. Instead, it is necessary to use React Native CLI.

StarXpand SDK for React Native uses the custom native modules format which can handle native iOS and Android code, but the custom native modules cannot be used with Expo CLI.

Reference


[All] Integer value of StarIO10ErrorCode

If you need to know the integer value of StarIO10ErrorCode for debugging purposes, you can do so by referring to the source code of it.


[Android] Error: Cannot access 'body': it is package-private in 'response'

By the specification changed of OkHttpClient, the implementation of StarIO10ValueConverter class has changed between react-native-star-io10 ver. 1.0.0 and that of ver. 1.1.0 or later.

When using okhttp libraries below ver. 4 due to consistency with other libraries and react-native-star-io10 ver. 1.1.0 or later, you need to change the below section to a method.

If it is used okhttp ver. 3.14.9, the body is available as a method. implementation 'com.squareup.okhttp3:okhttp:3.14.9 in build.gradle.

// implementation 'com.squareup.okhttp3:okhttp:3.14.9' in build.gradle

val client   = OkHttpClient()
val request  = Request.Builder().url("ANY URL").build()
val response = client.newCall(request).execute()

val newString = response.body?.string()   // Cannot access 'body': it is package-private in 'Response'
val oldString = response.body()?.string() // Work fine

If that of ver. 4.0.0 or later, the body is available as a property.

// implementation 'com.squareup.okhttp3:okhttp:4.0.0' in build.gradle

val client   = OkHttpClient()
val request  = Request.Builder().url("ANY URL").build()
val response = client.newCall(request).execute()

val newString = response.body?.string()   // Work fine
val oldString = response.body()?.string() // Using 'body(): ResponseBody()' is an error. moved to val

Clone this wiki locally