Skip to content

Use of API only available in iOS 8 #273

@ghugues

Description

@ghugues

[STHTTPRequest startAsynchronous] uses the sharedContainerIdentifier property of NSURLSessionConfiguration which is only available in iOS 8 and later. This results in a crash when using STTwitter on iOS 7.

Since STTwitter says it supports iOS 7, I consider it is a bug.

A simple solution is to wrap the call in a respondsToSelector: check like so :

if ([sessionConfiguration respondsToSelector:@selector(setSharedContainerIdentifier:)]) {
	NSString *containerIdentifier = _sharedContainerIdentifier ? _sharedContainerIdentifier : [[NSBundle mainBundle] bundleIdentifier];
	sessionConfiguration.sharedContainerIdentifier = containerIdentifier;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions