nst / STTwitter

A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1
BSD 3-Clause "New" or "Revised" License
999 stars 161 forks source link

Requests fails when used in iOS Share Extension #251

Closed tanmays closed 8 years ago

tanmays commented 8 years ago

Hello,

I've been trying out STTwitter in an iOS share extension to send a DM. I get the following error when doing so: Error Domain=NSURLErrorDomain Code=-995

Searched on Stackoverflow and the error is due to disk cache being denied by default to an extension. Adding a shared app group fixes the issue.

Adding the following to STHttpRequest.m:813 fixed the issue.

sessionConfiguration.sharedContainerIdentifier = @"group.com.appName";

Allowing user to set a shared app group name when initialising STTwitterAPI or something similar should help.