#agordeev

1 messages ยท Page 1 of 1 (latest)

plain kelpBOT
green briar
#

Hi there!

#

Do you see any errors returned in your code?

upper elbow
#

PS: I can't see any errors. The app just tries to discover a reader.

Here's the full console log output:

2023-08-23 08:50:16.467470-0400 Runner[4543:1005915] Metal API Validation Enabled
2023-08-23 08:50:16.828514-0400 Runner[4543:1005915] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
2023-08-23 08:50:16.854195-0400 Runner[4543:1006125] 10.7.0 - [FirebaseCore][I-COR000005] No app has been configured yet.
2023-08-23 08:50:16.936863-0400 Runner[4543:1005915] [Firebase/Crashlytics] Version 10.7.0
2023-08-23 08:50:16.991315-0400 Runner[4543:1006154] flutter: The Dart VM service is listening on http://127.0.0.1:53541/LAXXAgjQMY8=/
2023-08-23 08:50:19.956930-0400 Runner[4543:1006159] [ProximityReader] User cancelled
green briar
upper elbow
#

Yes

plain kelpBOT
tawny mauve
#

๐Ÿ‘‹ in your DiscoveryConfiguration what's the value of useSimulator ?

If it's true then your iPhone not showing up is expected since you're setting simulated to true

#

@upper elbow wanna make sure you saw my message above

upper elbow
#

It has false value

tawny mauve
#

Are you running a beta version of iOS?

upper elbow
#

No

tawny mauve
#

The SDK must be logging something out, are you sure these are the full logs?

upper elbow
#

Yes, I'm sure ๐Ÿ™‚

tawny mauve
#

What version of the SDK are you running? And what country are you testing from?

upper elbow
#

What is the expected behavior? The documentation didn't say anything about it

#

pod 'StripeTerminal', '~> 2.0'

#

Serbia

tawny mauve
upper elbow
#

Yes, it's based in USA

tawny mauve
#

Hmm I'm not sure if the real device also physically needs to be in the US or a supported country in order for this to work.
I assume you've been able to test using simulated reader already?

upper elbow
#

I assume you've been able to test using simulated reader already?

No. I wasn't able to get Tap to Pay working in any way.

tawny mauve
upper elbow
#

Installing StripeTerminal 2.23.1 (was 2.20.0)

#

Unfortunately, same result

#
2023-08-23 14:26:18.052550+0100 Runner[4631:1026197] Metal API Validation Enabled
2023-08-23 14:26:18.319092+0100 Runner[4631:1026197] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
2023-08-23 14:26:18.337572+0100 Runner[4631:1026412] 10.7.0 - [FirebaseCore][I-COR000005] No app has been configured yet.
2023-08-23 14:26:18.415146+0100 Runner[4631:1026197] [Firebase/Crashlytics] Version 10.7.0
2023-08-23 14:26:18.459755+0100 Runner[4631:1026445] flutter: The Dart VM service is listening on http://127.0.0.1:58007/3JFpeclRBa4=/
2023-08-23 14:26:21.551147+0100 Runner[4631:1026446] [ProximityReader] User cancelled

#

2023-08-23 14:26:21.551147+0100 Runner[4631:1026446] [ProximityReader] User cancelled

Isn't this related to Tap to Pay feature?

tawny mauve
#

It is. What happens if you set simulated to true

upper elbow
#

Same, but this log line doesn't come up

tawny mauve
#

Can you share your complete code?

upper elbow
#

Like, the entire project?

tawny mauve
#

Like any ViewControllers that have code for terminal

upper elbow
#

I use Flutter, so no ViewControllers used

Here's a method called upon the app start:


    func discoverReaders(completion: @escaping (Reader?, Error?) -> Void) -> Cancelable? {
        self.completion = completion

        let config = DiscoveryConfiguration(
            discoveryMethod: .localMobile,
          simulated: true
        )

        guard let terminal = terminalProvider.getTerminal() else {
            completion(nil, NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey: StripeTerminalError.stripeTerminalNotInitialized.message ?? ""]))
            return nil
        }
        return terminal.discoverReaders(config, delegate: self) {error in
            if let error = error {
                completion(nil, error)
            }
        }
    }

tawny mauve
upper elbow
#

I have that:


    // This delegate method can get called multiple times throughout the discovery process.
    // You might want to update a UITableView and display all available readers.
    func terminal(_ terminal: Terminal, didUpdateDiscoveredReaders readers: [Reader]) {
        // Select the first reader we discover
        guard let selectedReader = readers.first else { return }
        // Once we've received battery level, don't expect further callbacks
        guard selectedReader.batteryLevel != nil else { return }

        completion?(selectedReader, nil)
    }

The app works with physical Stripe reader just fine, FYI

tawny mauve
#

can you throw in a print statement in that function? Just want to make sure it's not getting invoked even when you set simulated to true

#

Are you writing your own flutter package for terminal SDK or using a third-party one?

upper elbow
#

None of that. I've written my own wrapper for StripeTerminal, just for the app.
Ok, it seems I'm getting a reader here! This condition filters it out: selectedReader.batteryLevel != nil

tawny mauve
#

Gotcha. That means it only fails on a real device, which I feel comes down to Tap to Pay on iPhone not being supported in the country your device is in

Apple might have some checks in the ProximityReader API that cancells the action for unsupported countries

upper elbow
#

Ok, thank you for helping @tawny mauve