Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to receive callback for reader updates #546

Open
Taha92 opened this issue Jan 14, 2025 · 0 comments
Open

Unable to receive callback for reader updates #546

Taha92 opened this issue Jan 14, 2025 · 0 comments

Comments

@Taha92
Copy link

Taha92 commented Jan 14, 2025

Summary

I am unable to receive any callbacks for updates (e.g., onReportAvailableUpdate, onReportReaderSoftwareUpdateProgress). I have onStartInstallingUpdate implemented. Other MobileReaderListener listener gets called as expected like onBatteryLevelUpdate or onRequestReaderInput.

Code to reproduce

`private fun connectUSBReader(reader: Reader) {
val connectionConfig = ConnectionConfiguration.UsbConnectionConfiguration(
locationId = userInfo.value?.locationId.default,
autoReconnectOnUnexpectedDisconnect = true,
usbReaderListener = mobileReaderListener
)

    val terminal = Terminal.getInstance()
    terminal.disconnectReader(object : Callback {
        override fun onFailure(e: TerminalException) {
            Log.e("TERMINAL_LOG", "disconnectReader: onFailure")
        }

        override fun onSuccess() {
            try {
                Log.e("TERMINAL_LOG", "disconnectReader: onSuccess")
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }

    })
    // Create a simulated reader (for testing purposes only)
    val simulatedReader = Reader(
        usbDevice = reader.usbDevice,
        isSimulated = true             // Set isSimulated to true for simulation
    )
    Log.e(
        "TERMINAL_LOG",
        "connectUSBReader: simulatorConfiguration " + simulatedReader.isSimulated
    )

    Terminal.getInstance().simulatorConfiguration = SimulatorConfiguration(
        update = SimulateReaderUpdate.REQUIRED,
        simulatedCard = SimulatedCard(testCardNumber = "4242424242424242"),
        simulatedTipAmount = 40
    )
    Terminal.getInstance().connectReader(
        reader = simulatedReader, // Pass a simulated reader
        config = connectionConfig,
        connectionCallback = readerCallback
    )
}`

Android version

Android 13

Impacted devices (Android devices or readers)

Stripe M2 card reader

SDK version

4.1.0

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant