Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removing 2 deprecated methods (#67) since Xcode is now enforcing that you don't use these methods, will likely block iOS 11 updates.
CFURLCreateStringByAddingPercentEscapes
is simple to replace withstringByAddingPercentEncodingWithAllowedCharacters
NSURLConnection is more involved to replace with NSURLSession. Since we aren't altering any of the connection configuration settings, we can just use [NSURLSession sharedSession]. It's a little trickier with SSL pinning. I added an AMPURLSession class that extends ISPPinnedNSURLSessionDelegate and wraps NSURLSession. I'm having to create a new NSURLSession each time you try to upload events, similar to how the previous AMPURLConnection creates a new connection with each request. Although I think you're supposed to try to re-use NSURLSessions, but I wasn't having much luck with a static instance in AMPURLSession.
This will bump the min iOS version to 9. This also verifies that the unit tests pass in iOS 11 (on iPhone X emulator). Will need to do some more additional testing on the demo app for the SSL pinning