Support legacy iPhone users

后端 未结 8 1997
慢半拍i
慢半拍i 2020-12-03 08:54

Now that iPhone SDK 4.0 is available for download, and iOS 4.0 will be available for consumers shortly, does it make sense to start using the new features available in the 4

相关标签:
8条回答
  • 2020-12-03 09:36

    progmr has already given a very good answer; one thing worth adding is some hard data:

    http://www.appleinsider.com/articles/10/07/22/chitika_ios_4_already_powering_50_of_iphone_traffic.html

    ie. 50% of the iphone users (that are installing and using apps with ads in them as of a July 2010) are still running versions prior to 4.0.

    0 讨论(0)
  • 2020-12-03 09:40

    It depends. You have at least 3 options and the best way to go depends on your app's requirements:

    1. Your app doesn't require any iOS 4.0 APIs - you should build with BaseSDK 4.0, but set Target Deployment to the minimum version you must have (ie: 3.0).
      Advantages: (1) Your app to run on any device that has at least that Target Deployment version and (2) it will support fast App switching on devices that have iOS 4.0. Disadvantages: You can't use any APIs from after your Target Deployment version.

    2. Your app would be better with 4.0 APIs but it would still be usable without them - if you can conditionally use 4.0 APIs either by providing reduced functionality when on pre iOS 4.0 devices or by providing similar functionality while using different APIs when on pre 4.0 devices, then you can build with BaseSDK 4.0, set Target Deployment to to the minimum version you must have (ie: 3.0) and conditionally use the iOS 4.0 API calls. Advantages: you can run on all devices that have at least your minimum iOS version. Disadvantages: all those conditional calls can get complicated.

    3. Your app requires some iOS 4.0 APIs in order to function - Here you have no choice. Build with BaseSDK 4.0, set Target Deployment 4.0 and use those 4.0 APIs.
      Advantage: code is simpler, no conditionals for iOS version Disadvantages: Your app won't run on iPads yet (they get 4.0 in "Fall 2010"), your app will never run on iPhones earlier than 3G (they don't get 4.0) and some iOS 4.0 features won't work on iPhone 3G.

    In all cases, your Base SDK will be 4.0, your Target Deployment will the minimum that you require, and if you need a newer API you can conditionally use it if the device has it.

    Just by compiling with BaseSDK 4.0 you will get fast app switching on 4.0 devices even if you don't use any 4.0 features. All apps should at least do that even if they target iOS 2.0. Don't use the 4.0 features if you don't need them and you can target a broader range of older devices and devices that haven't upgraded.

    This recent answer on SO summarizes how to do this setup for BaseSDK and Target Deployment and how to conditionally use APIs to target multiple firmware versions.

    0 讨论(0)
提交回复
热议问题