#asim_86993

1 messages · Page 1 of 1 (latest)

icy pastureBOT
atomic jasper
#

Did you have any error from the code here?

  useEffect(() => {
    const { error } = await discoverReaders({
      discoveryMethod: 'localMobile',
    });
  }, [discoverReaders]);
vocal roost
#

No Error come here,,
but this value come from the discoveredReaders state of useStripeTerminal hook

atomic jasper
#

Did you have any readers here?

      onUpdateDiscoveredReaders: (readers) => {
        // The `readers` variable will contain an array of all the discovered readers.
      },
vocal roost
#

here in reader this value come

[{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "cotsDevice", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": null, "locationId": null, "locationStatus": "unknown", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "fa3b71f4-0555-4b75-b7d6-538b4626c3a0", "settingsVersion": null, "simulated": true, "status": "unknown", "trackKeyProfileId": null}]

atomic jasper
#

Hmm not sure why. Have you tried with different device?

vocal roost
#

i tried it with Google Pixel 4 ...

#

1+ 7 pro but the same output..

#

Here also no error and reader come

useEffect(() => {
const initAndClear = async () => {
const { error, reader } = await initStripe();
console.log('Reader Data', reader + ' ' + error);

  if (error) {
    Alert.alert('StripeTerminal init failed', error.message);
    return;
  }

  if (reader) {
    console.log(
      'StripeTerminal has been initialized properly and connected to the reader',
      reader,
    );
    return;
  }
  console.log('StripeTerminal has been initialized properly');

};
if (hasPerms) {
  initAndClear();
}

}, [initStripe, hasPerms]);

golden ravine
#

Hi @vocal roost can you tell us what's your expectation of the readers that you receive in onUpdateDiscoveredReaders ?

vocal roost
#

Yes i used this one
"@stripe/stripe-terminal-react-native": "^0.0.1-beta.13",

golden ravine
#

I also noticed simulated:true in the response, which means that you are using a simulated reader.

vocal roost
#

First to discover reader we get this response from sdk, where the valuse is null, so how we go to next...my issue is here when we discover the value is null why?

[{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "cotsDevice", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": null, "locationId": null, "locationStatus": "unknown", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "fa3b71f4-0555-4b75-b7d6-538b4626c3a0", "settingsVersion": null, "simulated": true, "status": "unknown", "trackKeyProfileId": null}]

golden ravine
vocal roost
#

So when we remove the simulated:true we got this error

[Stripe terminal]: didFinishDiscoveringReaders {"error": {"code": "INTEGRATION_ERROR.LOCAL_MOBILE_DEBUG_NOT_SUPPORTED", "message": "Debuggable applications are not supported in the production version of the localmobile reader. Please use a simulated version of the reader by setting DiscoveryConfiguration.isSimulated to true."}}

golden ravine
#

You still need to specify a location ID anyway, so I'd suggest you to follow the link that I shared earlier to create a location, and pass in the location ID when calling connectLocalMobileReader

#

You need to pass in simulated:true unless you are building for prod

vocal roost
#

I confused, can we use static locationId from the link you give, OR we used it from discoveredReaders state of useStripeTerminal hooks

golden ravine
#

What do you mean by "static locationId from the link"?

vocal roost
#

I mean when we create locationId here how we get it in the code.

golden ravine
#

You'll get a locaiton ID after creating a location, a location ID starts with tml_