8

CONTEXT

I'm developing a Crossword game app that currently runs on iPad devices. Apple has recently released iPhone 6 and iPhone 6+ devices, which fortunately have a bigger screen and thus become eligibly to run my game (I have tested my game on a iPhone 5S device and if found that it was not pleasant to the user to run in such screen size).

In this way, I decided to migrate my app to an Universal binary that would include support for iPhone 6, iPhone 6 Plus and iPad devices.

QUESTION

  1. Is there any way to restrict my iOS app to run only on iPhone 6 and iPhone 6+ devices?

Or, at least:

  1. Is there any way to restrict my iOS app to run only on iPhone 6+ devices?
Eduardo Coelho
  • 1,953
  • 8
  • 34
  • 60
  • 1
    No. See http://stackoverflow.com/questions/17903577/how-do-i-limit-an-ios-app-only-to-4-inch-screen-devices, it's basically the same thing. – rmaddy Feb 15 '15 at 23:57
  • It's not exactly the same thing. These two new devices MAY introduce separated capabilities that would allow me to restrict it. Possible or not, that is still a relevant question - not exactly the same as the one pointed by you. – Eduardo Coelho Feb 16 '15 at 00:00
  • 1
    It's the same point though. Apple doesn't let you limit apps to a specific model. You can limit base on required device capabilities such as the M7 chip or a gyroscope. But your app must really need those features or it will be rejected. Find a way to support 3.5" and 4" devices or stay iPad-only. – rmaddy Feb 16 '15 at 00:02
  • I appreciate your help. The point is: what If my required capability is screen resolution/size? I don't see any difference with the capabilities mentioned by you, it's just another layer of indirection to limit apps to specific models in the same manner. NOTE: I'm not an experienced Android developer but I have deployed the same app on Android platform and I was able to remove 'smallScreens' from the deployment target anyway. – Eduardo Coelho Feb 16 '15 at 12:11
  • Apple does not provide screen sizes as a required device capability. Here's the kicker - any iPhone app must run as-is on the iPad and this requires support for 3.5" screens to work. This is why an iPhone app must support 3.5" and 4" screens and optionally (probably soon to be required) support for the iPhone 6 models. – rmaddy Feb 16 '15 at 16:55
  • You could provide a very limited app for smaller devices, like just a 1% of the real game... like screenshots of the real game or something. Tic-tac-toe... and then the real deal for iPhone 6/Plus? Just an idea, maybe the reviewer will hate you for it... – Jonny Jun 29 '15 at 15:12

1 Answers1

0

I know it's probably way too late, and probably doesn't answer the question anyway, but I figured 'what the heck' – it's a nice bit of code to determine ranges of devices, where in cases you may want different functionality.

#import <sys/sysctl.h>

-(BOOL)isANewerDevice{

    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
    free(machine);

    NSString * ending = [platform substringFromIndex:[platform length]-3];
    double convertedNumber = [[ending stringByReplacingOccurrencesOfString:@"," withString:@"."] doubleValue];

//Devices listed here: https://stackoverflow.com/questions/19584208/identify-new-iphone-model-on-xcode-5-5c-5s

    if ([platform containsString:@"iPhone"]) {
        if (convertedNumber >= 7.1) { // 6 and above
            return YES;
        }else{
            return NO; //less than a 6 (ie 5S and below)
        }
    }else if ([platform containsString:@"iPad"]){
        if (convertedNumber >= 5.3) { //iPad Air 2 and above
            return YES;
        }else{
            return NO; //iPad Mini 3 and below
        }
    }

    //Failsafe
    return NO;
}

The link that's commented in the code: Identify new iPhone model on xcode (5, 5c, 5s)

Note. Due to having containsString, this will crash on iOS versions less than 8. To support <8.0, try using the following code to retro-fit this function https://stackoverflow.com/a/26416172/1197723

Have fun!

Community
  • 1
  • 1
mylogon
  • 2,772
  • 2
  • 28
  • 42