star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
91 stars 55 forks source link

connectionSettings prop is empty after storing and retrieving printer in redux #83

Closed matthewparavati closed 9 months ago

matthewparavati commented 2 years ago

Description

We are having issues storing discovered printers in redux and then using them in different parts of the app or on subsequent app launches.

connectionSettings in these instances is always empty, which means I am unable to instantiate a new StarPrinter() with the correct settings for the identifier and interfaceType

I can access the connectionSettings via the private property (_connectionSettings), and though and this "works", my editor yells at me that it is private and I shouldn't be accessing it.

So two questions:

Your device where the bug occurs

Your printer

Your development environment

ProductName: macOS ProductVersion: 12.6 BuildVersion: 21G115

npx react-native info

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Pro
    Memory: 91.28 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
    Yarn: 1.22.19 - ~/Code/client-app/node_modules/.bin/yarn
    npm: 6.14.17 - ~/.nvm/versions/node/v14.20.0/bin/npm
    Watchman: 2022.10.03.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - ~/.rvm/gems/ruby-2.7.6/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 28, 29, 30, 31, 32, 33
      Build Tools: 30.0.3, 31.0.0, 33.0.0
      System Images: android-21 | ARM 64 v8a, android-28 | ARM 64 v8a, android-30 | ARM 64 v8a, android-30 | Google APIs ARM 64 v8a, android-31 | ARM 64 v8a, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.69.5 => 0.69.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Additional context

Any other context about your topic.

bandit-ibayashi commented 1 year ago

@matthewparavati We are afraid our late response. I would like more clarity on the timing of this issue.

You are probably getting StarPrinter instance of the printer found using onPrinterFound method, but is the connectionSettings property already empty at this stage?

Thank you in advance.

matthewparavati commented 9 months ago

@bandit-ibayash sorry for the delayed answer. I wasn't sure at the time and didn't find the time to revisit it.

Also, another member of my team worked on an implementation more recently and had more luck than I did so I will close this now