Closed sublime392 closed 1 month ago
Thank you for tracking! We can remove uname usage from haptics.
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;
Fixed in 3.1.0
correct @cjohn001 we don't use uname any longer.
@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.
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