#kpaxian7
1 messages · Page 1 of 1 (latest)
What does it give you after running this code? the "discoverReaders failed"?
no, nothing print
is something i need do with my reader?
fun initReader() {
Log.e("stripeTag", "initReader")
Terminal.initTerminal(context, LogLevel.INFO, object : ConnectionTokenProvider {
override fun fetchConnectionToken(callback: ConnectionTokenCallback) {
Log.e("stripeTag", "fetchConnectionToken")
discover()
}
}, object : TerminalListener {
override fun onUnexpectedReaderDisconnect(reader: Reader) {
Log.e("stripeTag", "onUnexpectedReaderDisconnect")
}
})
}
fun discover() {
Log.e("stripeTag", "discover")
val config = DiscoveryConfiguration(
discoveryMethod = DiscoveryMethod.BLUETOOTH_SCAN,
)
Terminal.getInstance().discoverReaders(config, this, object : Callback {
override fun onSuccess() {
Log.e("stripeTag", "discoverReaders succeeded")
}
override fun onFailure(e: TerminalException) {
Log.e("stripeTag", "discoverReaders failed = ${e.message}")
e.printStackTrace()
}
})
Log.e("stripeTag", "discover done!")
}
initReader
fetchConnectionToken
discover
and no more prints...
Hi! I'm taking over this thread. Give me a few minutes to catchup.
Which documentation link are you following?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
What's the exact issue you're facing? Do you see any errors?
What's the expected behaviour?
Could you please share your SDK version please?
Yeah
- my android device is nearby with my M2 reader, but i cant discover readers by methods "Terminal.getInstance().discoverReaders", is there need a connection token before doing discover?
Adding your initial message here:
seems being stuck at discoverReaders
-
implementation "com.stripe:stripeterminal:2.21.1"implementation 'com.stripe:stripe-android:20.25.8'
Don’t use mobile device settings to pair with your reader. Pairing the reader through device settings makes the reader unavailable to connect to your app.
From the doc, could you double check if it wasn't paired in the device settings?
i did nothing in my device bluetooth setting, i even cannot find my M2 reader in my Android bluetooth list...
i just want discover my reader in my app, but seems something wrong
Can you confirm that the discover() function is being called at all? Can you call it outside of initTerminal()?
yes it does
and no more print
and i got a question, i only do this test in my Android app, without bankend, is this step wrong?
Or i need register something (like token generate) first, then i can discover the Reader?
Yes, you will need to have a real connection token.
OH... Can you give me a complete step brief about M2 reader connection in Android app.
Thank you so much
Please try to follow this guide step by step: https://stripe.com/docs/terminal/payments/setup-integration
When you reach the point where you can access Terminal.getInstance(), you can go to the next steps: https://stripe.com/docs/terminal/payments/connect-reader
Happy to help!