How to declare an iPhone app which has to run in the background? - iphone

Hey,
I wrote an iPhone app which needs to run in the background. I did set up the properties in my info plist according to running in the background. The problem is that the app store lists iPhone 3G as well as "compatible device".
Is it possible to set up my info plist to get rid of the iPhone 3G in the app store?
I found one solution by adding 'opengles-2' to UIRequiredDeviceCapabilities - but it doesnt seem like the best way to do it?!
Thanks!

You can't discriminate directly on actual device types (3G versus iPhone 4 etc.), but as you note things in UIRequiredDeviceCapabilities may imply certain devices. However, there's a more direct route, read on...
If you require multitasking compatible devices, that would be any device running iOS4 or higher. There's a setting in your XCode project's build settings that allows you to set the minimum required iOS for your app to run -- "iOS Deployment Target". Set this to "iOS4" and your app will only be available to multitasking enabled iDevices (which includes iPad with iOS4 or higher, btw). -- no, not enough, see comments below and Jules' link.

Related

iPhone Target Certain Devices

I'm want to target the iPhone 4, iPhone 4S, iPod Touch (4th generation). I do not want to target the iPhone 3G and iPhone 3GS. I've seen some post that said this is not possible. However, I notice in the App Store that some apps do this such as the picture below.
How would I accomplish this?
Those requirements show up because the developers have put armv7 as an entry in the UIRequiredDeviceCapabilities Info.plist key. There's no key specifically to target the iPhone 4 and up, although you can probably eliminate the 3GS using one of the other keys.
Why are you trying to stop people from installing your app on older devices?
I believe you want to set UIRequiredDeviceCapabilities to specify exactly which features your app needs. For example, the camera-flash key is only going to be true for iPhone4 and later, if that's what you need.
There's also a Q&A article on it.
In addition to setting the features the device needs with UIRequiredDeviceCapabilities, you can also specify the minimum iOS version that needs to be installed.
See this Apple Technical Note, TN2250.

Exclude devices that do not support multitasking

I'm making an app that requires multitasking. Is there a way to compile an iPhone/iPad (universal) app so it excludes devices that do not support multitasking. I know iPhone 1, iPhone 3G and iTouch 1-2 do not support multitasking but I haven't found a way to build my app so it prevents people to download the app from the app store if they have one of these devices.
I was thinking to simply set the "Architectures" setting to armv7 on Xcode but I'm not sure if this will work and if it will have any other consequences.
Any help will be appreciated. Thanks!
You can set the minimum API level supported to be iOS 4.3. This version only runs on devices that support multi-tasking.
You should check in your application for multitasking support and fall back to a non multitasking alternative if it is not available.
Suppose you change the supported architectures to include ARM7 upwards. If you do, you need to find out what happens if somebody attempts to deploy such an application to an incompatible device. If iTunes stops them from doing it, that's fine and it's the right answer. But if iTunes lets them do deploy the app and it crashes when they try to run it, it would be far better to do the test for multitasking support and display an alert telling the user why your app won't work.
Go to targets section of your project--> navigate to Build Tab-->Go to Deployment tab & select IOS deployment target as 4.2. It will not run on IOS versions earlier than this.

Can a restrict my app to iPhone 3GS/iPhone 4?

I have an app which runs excellently on an iPhone 4, and comfortably on a 3GS. Is it possible to target only the 3GS/4 and not the 3G? The 3G just freaks out when I run it, all sorts of graphical glitches, crashing, low fps etc, I don't even want 3G users to see the app on the store. I can't really 'tone down' the app to use less memory/power for the 3G, it would remove the main purpose of the app.
The only way I have come up with is to adding multitasking as a requirement for the app in the info.plist, but this seems a little hacky.
Also, is this likely to get me in trouble as far as submission goes?
Add "armv7" to the required device capabilities of your app's info.plist. Only the 3GS and newer use that CPU architecture. An app requiring armv7 won't even install on a 3G and other older armv6 devices.
Looks like this has been addressed previously, you can determine the version and perform an appropriate action based on that.
Link to thread

Prevent iPhone app to run on iPad

I'm shipping two binaries; one for iPhone/iTouch and the other for iPad. It's the same application.
Will Apple ensure that the user will never receive an iPhone version of the app on the iPad? If YES, then I don't have anything to worry about, but if not then I do have a problem.
The reason I ask is the iPhone application will simply not work correctly on the iPad because the server knows it's an iPad and will deliver the iPad HD content to it and the iPhone cannot handle that. I would rather not hack my application to send the server a fake device type if running the iPhone app on the iPad in order to receive the correct resources.
Suggestions?
I've been looking for this for a while because I couldn't prevent the iPhone app to load on the iPad. Searched a bit to understand why this was happening, followed #hotpaw2 instructions and found this on the official apple store rules:
UPDATE:
2.4.1 To ensure people get the most out of your app, iPhone apps should run on iPad whenever possible. We encourage you to consider
building universal apps so customers can use them on all of their
devices. Learn more about Universal apps.
https://developer.apple.com/app-store/review/guidelines/
The SDK and/or App store rules prohibit you from preventing an iPhone app from running on an iPad in 1X or 2X zoom mode, unless there are other requirements listed in the app plist. Apple's app review is known to test iPhone-only app submissions (unless there are other requirements) on an iPad, and reject the app if it doesn't run properly.
Other requirements (as listed under UIRequiredDeviceCapabilities in the app's plist) might include your app requiring telephone capabilities (or healthkit, etc.), which might help you temporarily, but still won't prevent the app from running on some hypothetical future iPad product that includes telephony capabilities (and/or healthkit, etc.).
Actually you can.
Add telephony to UIRequiredDeviceCapabilities in your plist file.
But i really not recommend it and maybe you could get rejected because of gratuitously using this property.
I think you should handle that there are iPad versions and iPhone versions on iPads, use the second one as an iPhone.
Also don't forget that retina iPads will use upscaled applications at retina resolution while none retina ones use the standard resolution. And this behavior can tweaked using jailbreak tweaks like RetinaPad and FullForce.
In the plist settings, add Application requires iPhone environment and set the boolean to YES

How to keep iPhone app out of iPad store?

I have an iPhone app that I have started to turn into a universal app, however the process is not complete and I want to release an update to the iPhone version.
I know that you can specify device capabilities in the Info.plist file to restrict your app to certain devices, but how can I do this to prevent the unfinished universal version from appearing in the iPad store?
Is checking the LSRequiresiPhoneOS BOOL entry (in the Info.plist file) enough?
Thanks!
I'd consider restriction to iPhone very bad decision - the iPad is designed to run all iPhone apps in compatibilty mode (except for obvious things like telephony). So you will run into severe complaints.
If it is about the half-done enhancements for the iPad part, then just turn those features off and compile for iPhone (targeted device: only iPhone; maybe tweak the plist file, too).
You could use the UIRequiredDeviceCapabilities and specify that you require "telephony" in your info.plist. That would keep it off the iPad (and iPod touch too). See Device Support.
I found a setting under Project Settings -> Build that titled "Targeted Device Family." Maybe try setting this to just iPhone, not iPhone/iPad -- I think that should also help.