Closed roxk closed 2 years ago
Which are wrongs? Unix? rfc1123 seems to be the device name so that looks correct to me.
{
"ios": {
"uname": {
"machine": "iPhone13,1",
"release": "21.4.0",
"sysname": "Darwin",
"version": "Darwin Kernel Version 21.4.0: Mon Feb 21 21:27:55 PST 2022; root:xnu-8020.102.3~1/RELEASE_ARM64_T8101",
"nodename": "rfc1123"
},
"NSBundle": {
"CFBundleName": "Authgear Flutter",
"CFBundleVersion": "1",
"CFBundleExecutable": "Runner",
"CFBundleIdentifier": "com.authgear.exampleapp.flutter",
"CFBundleDisplayName": "Authgear Flutter",
"CFBundleShortVersionString": "1.0.0"
},
"UIDevice": {
"name": "rfc1123",
"model": "iPhone",
"systemName": "iOS",
"systemVersion": "15.4.1",
"userInterfaceIdiom": "phone"
},
"NSProcessInfo": {
"isiOSAppOnMac": false,
"isMacCatalystApp": false
}
}
}
Everything except nodename
is wrong. In particular, we need machine
to be correct because we use that to infer the device model for display purpose.
In that case I think can see see if DeviceInfo
in xamarin essential is returning useful stuff. Lemme see see. If still doesn't show iphone model specifically, we could go down the Dll import rabbit hole (it's a rabbit hole since Idk what the dll name should be for calling syscall)
Seems we can reference how xamarin essential does it.
According to observation, DeviceInfo.Name is nodename
, DeviceInfo.Machine is machine
. Let's see if we can get the dllImport stuff work. If not, just provide DeviceInfo.Name and DeviceInfo.Machine and leave other fields as empty string.
Any chance other information are stored in this "sysctl" API as well? If there are we can use this API to grab them.
In the mean time, I'm working on dllimport.
Looks promising, just need to figure out the property name of release and sysname.
Fixed by using sysctlbyname
.
Just tested and the current implementation does not look good.