Skip to content

[@nativescript-haptics] ReferenceError: uname is not defined when using iOS 8.8.x #596

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

Closed
sublime392 opened this issue Jul 25, 2024 · 4 comments
Assignees

Comments

@sublime392
Copy link

ReferenceError: uname is not defined
at deviceInfo (file: src/webpack:/nativescript-ib/node_modules/@nativescript/haptics/index.ios.js:87:0)

This does not happen when using iOS 8.7.1

@NathanWalker
Copy link
Contributor

Thank you for tracking! We can remove uname usage from haptics.

@cjohn001
Copy link

cjohn001 commented Aug 1, 2024

Hello together, I just ran into the same issue not being able to use uname anymore. I cannot simply remove its usage as I need to read the machine information. Can the uname function not be used in NS anymore or do I need to include it in a different way now? Thanks for your directions!

const _SYS_NAMELEN = 256;
const buffer = interop.alloc(5 * _SYS_NAMELEN);
uname(buffer);
const utsname = new Utsname();
utsname.sysname = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 0)).toString(); // sysname
utsname.nodename = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 1)).toString(); // nodename
utsname.release = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 2)).toString(); // release
utsname.version = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 3)).toString(); // version
utsname.machine = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 4)).toString(); // machine
deviceId = utsname.machine;

@NathanWalker
Copy link
Contributor

Fixed in 3.1.0

correct @cjohn001 we don't use uname any longer.

@cjohn001
Copy link

cjohn001 commented Aug 1, 2024

@NathanWalker: Thanks for the info. I suspected it. Fortunately, I found a way to do things without uname. I previously used it to detect, if the app is running on a simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants