iOS 9 and OSX 10.11 require TLSv1.2 SSL for all hosts you plan to request data from, unless you specify exception domains in your app's Info.plist file.
The syntax for the Info.plist configuration looks like this:
If your application (a third-party web browser, for instance) needs to connect to arbitrary hosts, you can configure it like this:
<key>NSAppTransportSecurity</key>
<dict>
<!--Connect to anything (this is probably BAD)-->
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
If you have to do this, it's probably best to update your servers to support TLSv1.2 and SSL. This should be considered a temporary workaround.
As of today, the prerelease documentation makes no mention of any of these configuration options in any specific way. Once it does, I'll update the answer to link to the relevant documentation.
Even though your sever supports TLSv1.2, you may also have to follow what I wrote above to ensure connecting successfully in iOS 9:
After some discussion with Apple Support, the issue is due to the self signed certificate.
ATS only trusts certificate signed by a well known CA, all others are rejected. As a consequence, the only solution with a Self signed certificate is to set an exception with NSExceptionDomains.
2.Demo2_iOS9 new feature in CoreLocation : backgroud when needed
If you're using CoreLocation framework in your app in Xcode7(pre-released), you may notice that there is a newly added property called allowsBackgroundLocationUpdates in CLLocationManager class.
The default value is NO if you link against iOS 9.
If your app uses location in the background without showing the blue status bar, you have to set allowsBackgroundLocationUpdates to YES in addition to setting the background mode capability in Info.plist. Otherwise location updates are only delivered in foreground. The advantage is that, in the same app, you can now have some of the location managers update locations in background, while others at foreground. You can also reset the value to NO to change the behavior.
The documentation makes it pretty clear:
By default, this is NO for applications linked against iOS 9.0 or
later, regardless of minimum deployment target.
With UIBackgroundModes set to include "location" in Info.plist, you
must also set this property to YES at runtime whenever calling
-startUpdatingLocation with the intent to continue in the background.
Setting this property to YES when UIBackgroundModes does not include
"location" is a fatal error.
Resetting this property to NO is equivalent to omitting "location"
from the UIBackgroundModes value. Access to location is still
permitted whenever the application is running (ie not suspended), and
has sufficient authorization (ie it has WhenInUse authorization and is
in use, or it has Always authorization). However, the app will still
be subject to the usual task suspension rules.
See -requestWhenInUseAuthorization and -requestAlwaysAuthorization for
more details on possible authorization values.
Set Info.plist like this:
The syntax for the Info.plist configuration looks like this:
3.iOS 9 Dealing With Untrusted Enterprise Developer
Since iOS 9, there is no more “trust” option for an enterprise build.
Before iOS 9, there used to have an alert popped like this:
Now:
Users have to do the configuration themselves:
Go to Settings - General - Profiles - tap on your Profile - tap on Trust button.
4.bitcode option
After Xcode 7, bitcode option is set enabled by default. If your library is complied without bitcode while the bitcode option is enabled in your project setting, you can
Update your library with bit code, or you'll get warnings like:
(null): URGENT: all bitcode will be dropped because
'/Users/myname/Library/Mobile
Documents/comappleCloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)'
was built without bitcode. You must rebuild it with bitcode enabled
(Xcode setting ENABLE_BITCODE), obtain an updated library from the
vendor, or disable bitcode for this target. Note: This will be an
error in the future.
Say NO to Enable Bitcode in your target Build Settings
and the Library Build Settings to remove the warnings
iOS 9 has made a small change to the handling of URL scheme. You must whitelist the url's that your app will call out by using the LSApplicationQueriesSchemes key in your Info.plist.
If you call the “canOpenURL” method on a URL that is not in your whitelist, it will return “NO”, even if there is an app installed that has registered to handle this scheme. A “This app is not allowed to query for scheme xxx” syslog entry will appear.
If you call the “openURL” method on a URL that is not in your whitelist, it will fail silently. A “This app is not allowed to query for scheme xxx” syslog entry will appear.
The author also speculates that this is a bug with the OS and Apple will fix this in a subsequent release.
This is a new security feature of iOS 9. Watch WWDC 2015 Session 703 for more information.
Any app built with SDK 9 needs to provide an LSApplicationQueriesSchemes entry in its plist file, declaring which scheme it attempts to query.
Assuming that we have two apps: Test A and Test B. TestB wants to check whether TestA is installed or not. "TestA" defines the following URL scheme in its info.plist file:
But this will generally return NO in iOS9, because "TestA" needs to be added to the LSApplicationQueriesSchemes entry in TestB's info.plist file. This is done by adding the following code to TestB's info.plist file:
How to make an old project support Slide Over and Split View in iOS 9?
You may find all the demo projects was written by storyboard or xib,
but the older project's UI is written by code!
I would suggest switching to storyboards to make your life easy.
I would highly recommend you to watch the following WWDC videos and then think about what exactly you need to do in order to support multi tasking.
7. UI Display Problem Due to Enlarged Character Space
iOS 9 introduced a new font of Chinese characters. The enlarged character space may cause display problems of text labels, especially for fixed label width.
To avoid this, we prefer to use ‘sizeToFit’ and ‘ceilf’ methods to calculate label size dynamically.
8. Crash and Warnings
Sina SDK crashes on iOS 9 with the following information: Solution: update SDK.
A case of Masonry crashing on iOS 9
left & leading, trailing & right: not equivalent any more. Some other modifications to make:
Old way of setting status bar style lead to errors. Solution: delete ‘View controller-based status bar appearance’ key in ‘Info.plist’, apply new methods to set status bay style.
Demo4 — set status bar style of navigationController
If it still does not work after using the above method, the problem is probably on your rootViewController.
Xcode 7 generates .dSYM file under debug circumstance and causes warnings. Solution: change debug setting. Prevent Xcode from generating .dSYM.
Xcode 7 cannot debugging on 8.x devices.
Solution: ensure the project name not including Chinese character.
Problem of jumping between Safari and other apps.
This is probably caused by using ‘iframe’ element in HTML.
Warning when locking screen while executing tasks in apps. Haven’t found a solution.
Crash when rootViewController not set in didFinishLaunchingWithOptions
Solution: initialize rootViewController in didFinishLaunchingWithOptions and replace it afterwards.
9. Search API
Import related frameworks, and configure ‘search elements’ just as configuring tableview cells: Demo 6 shows how to combine CoreSpotlightSearch and tableView:
10. Change of Device Language Return String
Before iOS 9: the above code returns language string code (e.g. “zh-Hans”).
iOS 9: returns language string code + area code (e.g. “zh-Hans-US"). Be careful when checking current language.
11. UITableView Display Problem
A project running well on Xcode 6 may encounter the following problems on Xcode 7:
Tableview created by code cannot hide cell separators.
reloadData does not work.
For cell separators, we provide two solutions (the first one preferred):
As for reloadData, we assume this may conflict with some new features. We can use local reload as an alternative:
Certificates must be signed using a SHA256 or better signature hash algorithm, with either a 2048 bit or greater RSA key or a 256 bit or greater Elliptic-Curve (ECC) key.
Invalid certificates result in a hard failure and no connection
请发表评论