react-native-serial-port-api icon indicating copy to clipboard operation
react-native-serial-port-api copied to clipboard

Problem to implement on expo app.

Open AndreOneti opened this issue 2 years ago • 7 comments
trafficstars

I have a problem on use the libon expo app,

image

And i try add permissions image

But it doesn't work either, can you help me?

AndreOneti avatar Mar 28 '23 12:03 AndreOneti

Can you upload your code snippet? I think it's not about permission.

bastengao avatar Mar 29 '23 00:03 bastengao

I Just implement this funcition

import SerialPortAPI from 'react-native-serial-port-api';

async function example() {
  const devices = await devicePathsAsync()
  console.log(devices)
}

example()

AndreOneti avatar Mar 29 '23 00:03 AndreOneti

I can't see any thing about SerialPortAPI.

bastengao avatar Mar 29 '23 03:03 bastengao

I can fix this error, i generated an build using the flag developmentClient in eas.json after install the lib.

But now, the software not list the device connected and it's always return []

AndreOneti avatar Mar 31 '23 11:03 AndreOneti

It is happening to me. I had the impression that the plugin is no link properly in expo. Could you give me some advise to resolve this issue?

Thank you

juanstan avatar Jun 18 '23 09:06 juanstan

Did you manage to get this to work in your expo app, @AndreOneti?

larshanskrause avatar Nov 01 '23 15:11 larshanskrause

I Just implement this funcition

import SerialPortAPI from 'react-native-serial-port-api';

async function example() {
  const devices = await devicePathsAsync()
  console.log(devices)
}

example()

I believe that devicePathsAsync() is a static function of the SerialPortAPI class. So you would have to call it like this

const devices = await SerialPortAPI.devicePathsAsync()

lagschwein avatar Jan 09 '24 03:01 lagschwein