Is this the proper way to detect which device a user is running?
NSString *currentModel = [[UIDevice currentDevice] model];
if ([currentModel isEqualToString:@"iPhone"]) {
// The user is running on iPhone so allow Call, Camera, etc.
} else {
// The user is running on a different device (iPod / iPad / iPhone Simulator) disallow Call.
}
It is not a general solution but Apple in many cases provides API calls to check wether specific feature is supported or not. Examples could be:
+isSourceTypeAvailable:and+availableMediaTypesForSourceType:inUIImagePickerControllerallowing you to check if camera is available for the current device.+canSendMailinMFMailComposeViewControllerto check if device is configured to send mail.-canOpenURLinUIApplicationclass to check if URL can be opened. For example it can be used to check if it is possible to make a phone call:If such API calls are available for your purpose I would use them rather then rely on hardcoded string identifiers.