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

Timeout for BT discovery scan #662

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

ianlin-bbpos
Copy link
Collaborator

Summary

Add timeout param for BT discovery scan.

Motivation

To support setting bluetooth discovery scan timeout.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@@ -22,6 +22,7 @@ export type LogLevelIOS = 'none' | 'verbose';
export type LogLevelAndroid = 'none' | 'verbose' | 'error' | 'warning';

export type DiscoverReadersParams = {
timeout: number;
Copy link
Collaborator

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

Suggested change
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
Copy link
Collaborator

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?

Copy link
Collaborator

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 👍

@nazli-stripe nazli-stripe merged commit 4bcb6b1 into main Apr 11, 2024
2 checks passed
@nazli-stripe nazli-stripe deleted the bbpos/support-discovery-timeout branch September 7, 2024 17:14
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

Successfully merging this pull request may close these issues.

3 participants