iOS Question Get iPhone Model

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi everybody! There is a way to get iPhone model (like iphone 4g, iphone 7 etc) on b4i?
I'm not able to work using inline obj-c, but i found this.

As wrote in the post, he used this to get what i want:

B4X:
#import <sys/utsname.h> // import it in your header or implementation file.

NSString* deviceName()
{
    struct utsname systemInfo;
    uname(&systemInfo);

    return [NSString stringWithCString:systemInfo.machine
                              encoding:NSUTF8StringEncoding];
}
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
Thanks Erel, i did not find it on forum when I tried to search it. I think you should to add it on code snippet section
 
Upvote 0
Top