IPod Touch with iOS8 Discovers as iPhone

I have an application that in the Contacts section allows the user to call us depending on the device. If it's an iPhone, it will show the number along with the call button. If it's an iPod Touch, it will just display the number. But since the update to iOS8, the iPod Touch also identifies as an iPhone and displays a call button. Does anyone know how to fix this? Any help is appreciated.

+3


source to share


2 answers


You can check if the iOS device can open the phone link:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+11111"]])

      



As mentioned in the following post:

How to check if an IOS device has phone capabilities?

+4


source


Check the device type as shown below:



- (NSString *) deviceType{
    NSString *devicePlatform = [self deviceModel];
    if ([devicePlatform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
    if ([devicePlatform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
    if ([devicePlatform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
    if ([devicePlatform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
    if ([devicePlatform isEqualToString:@"iPad1,1"])      return @"iPad";
    if ([devicePlatform isEqualToString:@"iPod5,1"]) return @"iPod Touch 5G";

    return devicePlatform;
}
- (NSString *) deviceModel{
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithUTF8String:machine];
    free(machine);
    return platform;
}

      

+1


source







All Articles