-
Notifications
You must be signed in to change notification settings - Fork 50
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
Timeout for BT discovery scan #662
Conversation
src/types/index.ts
Outdated
@@ -22,6 +22,7 @@ export type LogLevelIOS = 'none' | 'verbose'; | |||
export type LogLevelAndroid = 'none' | 'verbose' | 'error' | 'warning'; | |||
|
|||
export type DiscoverReadersParams = { | |||
timeout: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this an optional param
timeout: number; | |
timeout?: number; |
@@ -170,10 +170,11 @@ class StripeTerminalReactNative: RCTEventEmitter, DiscoveryDelegate, BluetoothRe | |||
func discoverReaders(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { | |||
let simulated = params["simulated"] as? Bool | |||
let discoveryMethod = params["discoveryMethod"] as? String | |||
|
|||
let timeout = params["timeout"] as? UInt ?? 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bric-stripe any issues with setting the timeout to 0 by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, no concerns. that's the native SDKs default as well 👍
Summary
Add timeout param for BT discovery scan.
Motivation
To support setting bluetooth discovery scan timeout.
Testing
Documentation
Select one: