#agordeev
1 messages ยท Page 1 of 1 (latest)
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
Got it. And I'm guessing you are following this documentation? https://stripe.com/docs/terminal/payments/setup-reader/tap-to-pay
Yes
๐ 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
It has false value
Are you running a beta version of iOS?
No
The SDK must be logging something out, are you sure these are the full logs?
Yes, I'm sure ๐
What version of the SDK are you running? And what country are you testing from?
What is the expected behavior? The documentation didn't say anything about it
pod 'StripeTerminal', '~> 2.0'
Serbia
Is your stripe account located in a diff country?
We don't support Tap to Pay in Serbia
https://stripe.com/docs/terminal/payments/setup-reader/tap-to-pay?platform=ios#availability
Yes, it's based in USA
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?
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.
Can you try updating the SDK to the latest version?
The latest version for iOS is 2.23.1
https://github.com/stripe/stripe-terminal-ios
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?
It is. What happens if you set simulated to true
Same, but this log line doesn't come up
Can you share your complete code?
Like, the entire project?
Like any ViewControllers that have code for terminal
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)
}
}
}
Hmm I'm not super familiar with flutter as we don't have first party support for it but typically you'd also need to implement a delegate method in order to listen for an update when readers are discovered
https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=ios&reader-type=tap-to-pay#discover-readers
// In your app, display the ability to use your phone as a reader
// Call `connectLocalMobileReader` to initiate a session with the phone
}```
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
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?
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
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
Ok, thank you for helping @tawny mauve