ios icon indicating copy to clipboard operation
ios copied to clipboard

Readout of deviceId crashes runtime

Open cjohn001 opened this issue 4 years ago • 1 comments

Hello together, I have the following code snipped which I used to read out the deviceId. The last line now crashes the runtime. If someone know of a workaround, would be great to have it mentioned here. Thanks!

"@nativescript/ios": "version": "8.1.0-rc.1",

const systemInfo = new interop.Reference(); uname(systemInfo); deviceId = NSString.stringWithUTF8String(systemInfo.value.machine).toString();

cjohn001 avatar Aug 15 '21 21:08 cjohn001

Ok, this here works as a workaround:

const _SYS_NAMELEN = 256; const buffer = interop.alloc(5 * _SYS_NAMELEN); uname(buffer); deviceId = NSString.stringWithUTF8String(buffer.add(_SYS_NAMELEN * 4)).toString();

cjohn001 avatar Aug 15 '21 21:08 cjohn001