iPad: What happens to iAds if iOS on user's machine doesn't support them? - objective-c

Ok,
So say I put some iAds in my iPad app. Assuming that I implement it via the iOS4.2 update that comes out next week.
Now, say I release my product but the majority of users haven't installed iOS4.2 in their iPads yet. Does that mean that my app will not run on their systems (meaning, my app requires iOS4.2), or does it mean that it'll run in their system (say iOS 3.2.2) but just the iAds won't show?

Regarding making your app available on iOS 3.2 devices: Make sure to weak link iAd.framework (i.e. in your target's settings, choose 'Weak Link' next to iAd.framework) as it is not available on iOS 3.2. You should also check for availability like
if (NULL != NSClassFromString(#"ADBannerView"))
{
// handle ad loading here
}
else
{
// no iAds available.
}

It depends how you compiled your app.
You can specify that an app can run on iOS 3.2.2, but can still use features of iOS 4.2, by carefully checking the availability before using these features.
You can also specify that your app can only run on iOS 4.2 and later; then you can use iOS 4.2 features without checking the availability.
So, it's your choice. Read this Apple document.

Related

How to stop supporting iOS7

I have just installed Xcode 5, and I have an application that should be targeted only to iOS 6.0 and iOS 6.1 devices.
How can I stop supporting iOS 7.0 ??
That is not possible, you can stop supporting previous versions of iOS, but not the other way. You need to prepare your app to work on iOS7.
YOu don't need to redesign your app or anything, just open in with XCode 5 and get rid of all the warnings/small bugs.
As others have noted, you can't "not support iOS 7". However, you can delay upgrading to the iOS 7 SDK (at least, in the short term).
To do such, simply continue using Xcode 4 to build your app. When you're ready to submit it, simply do such using Xcode 4 like you normally would.
For the time being, Apple will most likely accept apps built using the iOS 6 SKD. (Imagine, for example, that you've spent several months or a year building your app... Apple will still let you submit it for the time being even using an older SDK).
Further, the app will run and appear correctly (in many/most cases) using iOS 6 UI components for the most part (in example, UIAlertView is an exception to this, which will use the iOS 7's UIAlertView look).
In the long term, however, you really should convert your app to use the latest SDK.
It's not possible to prevent the installation of your app to devices that meet minimum version requirements.
Of course, you're free to check in your app the iOS version and do something about that. For example, if your concern is really that the user user should download another, iOS 7-designed version of your app, you can inform her about this possibility:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([self.window respondsToSelector:#selector(setTintColor:)]) // iOS 7
... // redirect user to better, tint-enabled version
return YES;
}

Support of iPhone 3G

I have submitted one iPhone app 6 times, and in the requirement of the last/ current version, iPhone 3G is not supported anymore.
My question: Why do I lose this model?
I have some remarks:
Now, apps don't support the iPhone 3G anymore.
I made some searches, and I didn't find any news about it.
Before I submitted this version, I updated my XCode from version 4.0.2 (iOS SDK 4.3) to version 4.2 (iOS SDK 5).
Maybe during the submission, "Apple" checked the binary in order to check the version of my tools (which I built my app with).
And as the iOS 5 cannot be installed on iPhone 3G, I have lost this support.
I own an iPhone 3G in order to make compatibility tests.
And with XCode 4.2, I had trouble to debug my App with my iPhone 3G.
But, i found the solution: Add the architecture armv6 is not enough I need to put some weak links.
If I submit my app with these options "special 3G", will these options be take into account and the support will be back?
(see the edit)
"What's new" is I changed my Apple Account: I submitted my app with another account.
Maybe there are some options somewhere that I didn't see.
Edit: I forget a part maybe important: the version of iOS.
The minimum version of iOS for running my app is iOS 3.1.
And my iPhone 3G runs on iOS 3.X
And all troubles I had with XCode 4.2 and my iPhone 3G seem to be the version of iOS (3.X).
Maybe my app lost the support of iPhone 3G to be sure there is no problem with iOS SDK 5 and iOS 3.X
But, there are users with an iPhone 3GS running on iOS 3.X.
I made some tests with one iPhone 3GS running on iOS 4.0: I had no issues and no options to add in my project settings.
Thanks for your answer. The problem may be the version of my XCode.
Like I said, I have already added the architecture armv6. But with my iPhone 3G iOS 3.X, this is not enough.
Did you test only this setting with one iPhone 3G with success?
I should do:
Add the architecture arm6
Set the Base SDK with "Latest iOS" (iOS 5.0)
Set the iOS Deployment Target with the minimum value
--- It's what you advice ----
Remove into the info.plist the parameter "Required device capabilities" (armv6 and armv7)
Add SystemConfiguration.framework as Optional (to make a weak link)
With this settings, my app crashes: "dyld: Symbol not found: __NSConcreteGlobalBlock"
So I should also add in the flag "Other Linker Flags", - weak_library /usr/lib/libSystem.B.dylib
This is one of my questions:
If I submit my app with these options "special 3G", will these options be take into account and the support will be back?
By default, Xcode 4.2 does not include support for the iPhone 3G, but you can add it back. Just select your app target and select "Build Settings". At the top, change the Architectures listed from "Standard (armv7)" to "Other". In the pop-up box, select the existing option and click the minus button, then click the plus button and add "armv7", then again click plus and add "armv6". armv7 will support the newer chips, while armv6 will add back in support for the iPhone 3G... providing you set your iOS Deployment Target to iOS 4.2 or earlier... your setting at 3.x should be just fine—that merely limits you to not using newer features of iOS obviously.
You may also need to add "-mno-thumb" under "Other C Flags" in the Build Settings, though if my memory serves me correctly that may only have been if you are wanting to use Automatic Reference Counting on the old architecture—and even then only because this is a work-around for a known bug.

iOS 4.2 SDK download

Does anyone know where I can get the iOS 4.2 SDK for xCode? I cannot find it anywhere on the Apple site.
I am building an App for Verizon Phones which only supports iOS 4.2. I get a runtime error that says 'Symbol not found' for AdInterstitialAd. I am not sure, but I am guessing I am getting that error because I added the iAd.framework from the iOS 4.3 SDK.
To submit an app to the App Store you will always build against the latest SDK which is 4.3. Apple will reject your app if you don't. You can set the deployment version of your app to lower version. And you are correct, AdInterstitialAd is only available in 4.3 or higher. You can still use the ADBannerView in the lower version.
If you want to use AdInterstitialAd in your app, you will have to use weak linking to make sure the framework if avaiable.
For example:
class adClass = NSClassFromString(#"AdInterstitialAd");
If (adClass) {
// do full screen ad stuff
} else if ((adClass = NSClassFromString(#"ADBannerView")) {
// do banner ad stuff
}
Using iAds While Maintaining Backwards Compatibility is a blog that provide some tips for using iAds when it was first announced last year. Some of those tips are this valuable today.
http://www.felixbruns.de/iPod/firmware/

iphone Dev. How can I make my app compatible with iOS 3 and iPads at the same time (iOS 4.2)

I've been looking around for a way to make my application compatible with iPhones-iOS3 and at the same time make it compatible with iphones and iPads that have iOS 4.2
I have seen some apps on the app store that claim to be compatible with iphones iOS3 and above, and with iPads.
Any idea on how they do that? How do they test against the different versions and how do they compile the final version that gets uploaded on the app store.
To make your app load in both iPad and iPhone, just make sure you have 2 different xibs to cater for each device, at application launch, check the device whether it's an iPad or iPhone and load the xib file accordingly.
iOS3 and multitasking unsupported devices will call applicationDidTerminate method when home button is pressed. iOS4 onwards, just make sure applicationDidEnterBackground method is implemented to support multitasking. You could also uncheck in the Info.plist file that your app does not support multitasking (not recommended by Apple), iOS will call applicationDidTerminate instead and the app will still be usable in both iOS3 & iOS4.
Cheers.

Can I build for 4.x simulator but run in 3.x simulator?

Ok, there have been some questions alluding to this before, and I've even read some second-hand reports of people successfully doing this, but so far I haven't found a concrete answer.
Basically, I want to build an application for simulator using iOS 4.x, and then run it on a 3.x simulator.
I have both SDKs installed, so all I need is the last mile of getting the app to show up in the 3.x simulator.
I tried just copying the app across from Library/Application Support/iPhone Simulator/4.2/Applications to Library/Application Support/iPhone Simulator/3.0/Applications but it doesn't show up when I load the 3.x simulator. There's a binary plist called applicationstate.plist, which I'm guessing keeps track of what apps are installed on the simulator, but I don't know what the binary format is so I'm kind of stuck at this point.
Has anyone managed to load a 4.x app onto a 3.x simulator? And if so, how did you do it?
Why are you even trying to do this? What are you trying to achieve? If what you really just want to do is ensure the app works on iOS 3.x then simply state that in xcode and don't worry about the actual simulator. The simulator could be running iOS 5.0 for all you should care as long as you have set 'iOS Deployment Target' to '3.0' in xcode's project settings. That will ensure the application is compatible with iOS 3.x and above. Obviously you then still need to ensure you're not calling methods from SDK 4.x when it will run on an iOS 3.x device. If that is what you're trying to test then what you're doing won't actually work. You should (as Apple advises) always grab hold of a real device running the target firmware version and test it on that. Grab an old iPod for example with iOS 3.x and try testing your app on that to ensure you haven't called iOS 4.x methods when running under an older firmware.
The answer is: No, you cannot build for 4.x simulator and run on a 3.1.x simulator or earlier due to fundamental changes in the way the simulator works.
The only way to test 3.x support is to either run it on a 3.x device (after setting min deployment target), or build on an older xcode that supports 3.x simulator (which isn't feasible if you use Xcode 4, except for iPad 3.2).
Note: Setting the deployment target does not test compatibility with older operating systems. It's the operating system that it actually RUNS on that matters (such as "iPhone 4.3 Simulator", "iPhone 4.0 Simulator", "iPad 3.2 Simulator", or an actual device).
Of course, now that 3.x users make up less than 10% of the total population, it's not really worth the trouble to support it anymore.