[TIMOB-19154] iOS9: Replace NSURLConnection in Ti.Network.HTTPClient with NSURLSession
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-22T21:09:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.1.0 |
Components | iOS |
Labels | httpclient |
Reporter | Chee Kiat Ng |
Assignee | Vijay Singh |
Created | 2015-07-03T03:13:33.000+0000 |
Updated | 2018-02-23T16:21:22.000+0000 |
Description
NSURLConnection methods have been deprecated in iOS9 in favor of NSURLSession.
WWDC 2015 reference
https://developer.apple.com/videos/wwdc/2015/?id=711NSURLConnection reference
https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/index.html#//apple_ref/doc/uid/TP40003755NSURLSession reference
https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSURLSession_class/index.html#//apple_ref/doc/uid/TP40013435Affected Titanium Class
https://github.com/appcelerator/APSHTTPClientAttachments
File | Date | Size |
---|---|---|
appcelerator.https-iphone-2.3.0.zip | 2018-02-01T01:24:24.000+0000 | 2978522 |
Screen Shot 2015-07-03 at 11.19.15 am.png | 2015-07-03T03:39:16.000+0000 | 89745 |
Screen Shot 2015-07-03 at 11.22.50 am.png | 2015-07-03T03:39:16.000+0000 | 50639 |
Master PR: https://github.com/appcelerator/titanium_mobile/pull/7030 APSHTTPClient PR: https://github.com/appcelerator/APSHTTPClient/pull/26
Steps to Test
1. Include this in in ios plist in tiapp.xml in KitchenSink2. Run KitchenSink 3. Go to *platform->XHR* 4. Test every functionality there, except the following: - Cookies since the url is outdated. - FileDownload -> Large File Download. URL here is outdated too. It's possible to replace this one to test further. Use http://ipv4.download.thinkbroadband.com/200MB.zip
Expected Result
Everything should work.*Note*: There should be a blog post and documentation ticket to inform titanium devs about the requirement to set NSAppTransportSecurity key in tiapp.xml.
PRs merged.
Reopening because PRs were implemented wrongly. New PR here to revert the changes to ensure everything still works for Release 5.0.0. https://github.com/appcelerator/APSHTTPClient/pull/30 https://github.com/appcelerator/titanium_mobile/pull/7078 And pushing this to Release 5.1.0.
APSHTTPClient PR:https://github.com/appcelerator/APSHTTPClient/pull/31 Master PR: https://github.com/appcelerator/titanium_mobile/pull/7137 5_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/7138 MERGE AFTER 5.0.0.GA is released.
PR's reviewed, tested & approved. Thank you Kiat!
Verified fixed, using: MacOS 10.11.2 (15C27e) Studio 4.4.0.201510280736 Ti SDK 5.1.0.v20151028190028 Appc NPM 4.2.1 Appc CLI 5.1.0-38 Ti CLI 5.0.5 Alloy 1.7.16 Arrow 1.3.13 Xcode 7.2 (7C46l) Node v0.12.7 Java 1.7.0_80 production Ran the sample code and each of the tests/outputs passed or matched the expected for an iOS 9.2 device.
six months later and still critical ... more than ever. any plans to finish this one soon? sidenote: this ticket blocks us today from testing secure http/2 connections using the standard sdk; and apple's deadline is coming closer...
[~tom] We do understand your concerns and the priority of this ticket, but we also have to schedule it properly to match the current roadmap and tickets that are included in it. The current roadmap for this ticket is *Release 7.0.0*, but we will keep this ticket up-to-date if there is an earlier release possible. Thanks!
APSHTTPClient PR - https://github.com/appcelerator/APSHTTPClient/pull/40 appcelerator.https PR - https://github.com/appcelerator-modules/appcelerator.https/pull/46 Master PR - https://github.com/appcelerator/titanium_mobile/pull/9366 7_1_X PR - https://github.com/appcelerator/titanium_mobile/pull/9854
28 test-cases: https://gist.github.com/hansemannn/5021f0aaf2bcbe5ed054449912f3b92b Two additional ones (stress-tests in successively and concurrent): *Successively*
*Concurrent*
FR Passed. Tested using all of the sample and referenced tickets in the issue ticket as well as the module examples and http test suite
Verified changes are included in SDK builds: 7.1.0.v20180222163802 & 7.2.0.v20180223044652