Change Devices parameter of iOS project programmatically - ios

I have to make my app run on iPad in iPhone mode(legacy zoomable mode).
I can do it with changing Devices option in Xcode project settings, But i released my app in app store in universal device mode so apple says you can't remove this feature in newer version of your app!
Is there any way to do it programmatically? for example can i set Devices option to iPhone in code at runtime? or can i fake it?(made app run like iPhone app in zoomable mode in iPad)

There is no possible way to change an iPad app to iPhone-only at runtime. It would be possible to display your view controllers on an iPad in such a way that they appear the size of an iPhone. But Apple would reject your app for bad user experience.
Once you release an app as Universal, Apple will not let you change the app to iPhone-only. And why would you want to do that? Why would you deliberately want to hurt your customers using iPads?
Your only solution would be to release a brand new app (different bundle id) that is iPhone-only. But then this is bad for all of your existing users (iPhone and iPad).
The proper solution is to embrace your Universal app and properly support iPads.

Related

How to restrict an application to download only in iphone and not in IPad

I have an only iPhone application I don't want to use this application install on iPad because some UI doesn't look good on iPad!
I can select "iPhone" in General-->Deployment Info-->Device
My app install on iPad like mode iPhone 1x size I want to restrict this installation.
Does anyone know to how to restrict app on iPad installation?
You can simply change Development Devices from Project's general target page.
from Xcode 11 Beta
from Xcode 10.3
You can restrict the application by programmatically from app delegate method.
You just check the for current device type.
Than navigate to another screen which is design out of the current storyboard just one screen to tell to user why they are not able to use your application.
NOTE : You have to mention all details in Appstore description to save your application rejection chances.

Apple Rejection App: We also noticed that your app did not run at iPhone resolution when reviewed on iPad running iOS 10.2.1 [duplicate]

I made an iPhone App with Xcode. The devices setting is set to "iPhone". But in iTunes Connect it is rejected because it doesn't run on the iPad.
That is weird because it is an iPhone app, but when I checked it in Xcode, I can run it with the iPad simulator,however I think that normally this is not possible with an iPhone app.
I have added pictures to make my question clearer:
So what is gone wrong and how can I fix it?
EDIT:
Picture from resolution center:
Thanks all, I Found the problem/solution:
In my info.plist there was an extra row called supported interface orientations(iPad) where the portrait mode was added.
I have no idea how this got added here but when I removed it, the problem was solved.
From the Apple iOS App Store Review Guidelines (https://developer.apple.com/app-store/review/guidelines/):
2.10 iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution
Basically, if you set an app to "Universal" it will have iPad and iPhone versions of the UI and will appear in the search results for both. If you set it to iPhone only, it will still be installable on iPads, but it doesn't appear in the search results by default. Additionally when a user does install it on an iPad it will just scale up the UI to best fit the screen. You cannot prevent your app from running on iPads.
Every app can run on the iPad no matter if it is supported or not. The option you have in Xcode is if you want to configure it to look good on the iPad using it's own storyboard. If you configure it for both iPad and iPhone your app fill get a + in the right corner of the price on the App Store and show up on iPad searches. However if you don't configure it to support iPads it'll not show up on searches of the Apple App Store, unless osmose selects iPhone only. You can easily submit your app to the App Store, without it being rejected my friend.
Hope that helps. Keep coding.
Nothing is wrong here , you can do this in debug mode for development purpose. Even you can run it on your iPad device from xCode. Don't worry about it, nothing wrong here.

Devices says IPhone but application can still be downloaded for ipad?

I recently pushed an application to appstore. Now i have no idea why, but it says that its compatible with ipad too. In Deployment info i picked IPhone only. How is this possible and how can i change this fast.
Thank you
Even if you have chosen iPhone in Deployment info. The app will still get install in iPad. Here are list you can chose in deployment info.
Universal :- These apps are designed to work on both iPhone and iPad.
When running on an iPad, these apps confirms to the larger screen of iPad as well as screen of iPhone.
iPhone apps :- These are apps designed specifically for iPhone. These apps can still run on iPad. However they will run on iPhone compatibility mode. There are some apps that utilize unique features of the iPhone such as ability to place phone calls. These apps will be unavailable to iPad.
iPad :- Designed specifically for iPad. Cannot install on iPhone.

iOS: Which flag in Xcode will declare my app for both iPhone and iPad?

I have developed an educational app, and have built it with a storyboard of iPhone. It is working perfectly on iPad without a need for a change (except for pressing the 'X2' button).
Now that the app is active in App Store, I see that iPad users who search for my keywords, do not receive my app in their search results, unless changing the top menu from 'iPad Only' to 'iPhone Only'.
I am wondering if there is a flag that will set my app to appear in the search results for iPad users too.
Or am I forced to create another storyboard?
Will appreciate you help!!
There is no flag for that.
You can create a Universal App (meaning you do support both iPhone and iPad) which then will mean your app is listed in both iPhone and iPad searches on the App Store, however you need to also provide a UI for the iPad version too in this case!
I have found the answer to be: Targeted Device Family
When setting it for both iPhone and iPad, a different UI will be presented for iPad, and you should adapt it to appear correctly.
EDIT
As mentioned by #Lefteris, each target can be marked as universal for that same purpose, but Targeted Device Family exists in the project level and allows setting that flag for all target at once.
I'm still missing a practical guide for turning an iPhone app into universal: how to add a storyboard and how to turn a two-levels behavior (table -> data) into a split table view.

Create iPhone app now with plans to support iPad later

I would like to create an iPhone app for now and get it released with plans to make an iPad app later. I don't want to charge people twice to get both versions. Do I create a universal app now and delete the iPad storyboard or do I create an iPhone app now and add an iPad storyboard later(if that is even possible)?
If you make it a universal app, then it will be available for both iPhone and iPad. So you should definitely not publish a universal app now it you want to support the iPad only later.
Later, it is easy to change the type of the app to universal, and make the appropriate changes in your code to add support for the iPad.

Resources