ONLY for iOS version 15.3.1 & 16.2, we are getting device identifiers instead of device name on screen. For Eg. 1. if im using iPhone 13, then I am getting iPhone 14,5 as a device name
- If I am us gin iPhone 11, then I'm getting iPhone 12,1 as a device name. I want right device name, not its identifiers. What can be the solution. It is happening only for iOS versions 15.3.1 & 16.2.
+ (NSString *)getName:(char *)typeSpecifier { size_t size; sysctlbyname(typeSpecifier, NULL, &size, NULL, 0); char *machinedetails = malloc(size); sysctlbyname(typeSpecifier, answer, &size, NULL, 0); NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding]; free(answer); return results; } + (NSString *)platform { return [self getName:"hw.machine"]; }
Thanks
please provide a solution.