sdk-t6
v0.1.1
Published
React native port for pos t6
Maintainers
Readme
sdk-t6
sdk-t6 is an Expo module for T6 POS device integrations.
It currently provides:
- Magnetic card reader APIs
- Customer aid screen (top small screen) APIs
Platform support
- Android: supported
- iOS: not supported for hardware APIs (throws platform-not-supported errors)
- Web: not supported for hardware APIs (throws platform-not-supported errors)
- Expo Go: not supported (requires native module in a development build)
Installation
npm install sdk-t6Important: vendor SDK binaries are not bundled
This package intentionally does not publish vendor .jar/.aar files to npm.
For Android hardware features to work, add the vendor JAR manually after install:
- Obtain vendor SDK JAR from your device/vendor package.
- Copy it to:
node_modules/sdk-t6/android/libs/T1_V2_20250826.jar
- Rebuild your Android development client.
Android setup checklist
- Use a development build (
expo run:android), not Expo Go. - Ensure vendor JAR exists under
node_modules/sdk-t6/android/libs/. - Rebuild after adding/replacing the JAR.
- Run Metro with dev client:
npx expo start --dev-client -cThe module manifest includes required permissions:
android.permission.CLOUDPOS_MAGCARDandroid.permission.CLOUDPOS_MAGCARD_GETTRACKDATAandroid.permission.CLOUDPOS_EMVL2android.permission.CLOUDPOS_SYSTEMDEV
Quick usage
import SdkT6 from 'sdk-t6';
import type { MagCardEvent } from 'sdk-t6';
import { useEvent } from 'expo';
const event = useEvent(SdkT6, 'onMagCardEvent') as MagCardEvent | undefined;
await SdkT6.magOpenAsync();
const card = await SdkT6.readMagCardAsync(60_000);
await SdkT6.magCloseAsync();Aid screen example:
await SdkT6.smallScreenWakeAsync();
await SdkT6.smallScreenSetBrightnessAsync(80);
await SdkT6.smallScreenDisplayTextAsync('USD 123.45', 'xlarge', 'center');API overview
Magnetic card:
readMagCardAsync(timeoutMs?)cancelReadMagCardAsync()magOpenAsync()magCloseAsync()magSearchAsync(timeoutMs)magStopSearchAsync()- event:
onMagCardEvent
Aid screen:
smallScreenWakeAsync()smallScreenSleepAsync()smallScreenSetBrightnessAsync(brightness)smallScreenGetBrightnessAsync()smallScreenGetSizeAsync()smallScreenDisplayTextAsync(text, textSize?, displayMode?)smallScreenDisplayImageBase64Async(imageBase64, align?, options?)smallScreenStopAppControlAsync()
Image options (Android):
width,height(target image box size in pixels)padding,paddingHorizontal,paddingVertical,paddingLeft,paddingTop,paddingRight,paddingBottomcontentFit:contain|cover|fill|none
Module docs
- Magnetic card guide:
docs/Magnet_card_module.md - Aid screen guide:
docs/Aid_screen_module.md
Local example app
From this repository:
cd example
npx expo run:android
npx expo start --dev-client -cTry these example screens:
example/MagnetCardScreen.tsxexample/AidScreen.tsx
Troubleshooting
ERR_MAG_SERVICE_UNAVAILABLEorERR_SMALL_SCREEN_SERVICE_UNAVAILABLE:- vendor JAR missing, wrong path, or app not rebuilt
ERR_MAG_BUSY:- another magnetic operation is already active
- Platform-not-supported error:
- running on iOS/web or Expo Go
License
MIT
