Twitter Search API using TwitterKit not working in iOS 9 but working in iOS8


#1

Hey Guys,

It seems the same code base which is working on iOS8 is not returning any tweets for iOS 9 using TwitterKit
TWTRAPIClient *_apiClient = [[TWTRAPIClient alloc] init];

if([PFTwitterUtils isLinkedWithUser:[PFUser currentUser]]) {
    NSString *userID = [Twitter sharedInstance].sessionStore.session.userID;
    _apiClient =  [[TWTRAPIClient alloc] initWithUserID:userID];
}


NSURLRequest *request = [_apiClient
                         URLRequestWithMethod:@"GET"
                         URL:statusesShowEndpoint
                         parameters:params
                         error:&clientError];




if (request) {
    [_apiClient
     sendTwitterRequest:request
     completion:^(NSURLResponse *response,
                  NSData *data,
                  NSError *connectionError) {
         
         NSLog(@"response: %@", response);
         NSLog(@"data: %@", [NSString stringWithUTF8String:[data bytes]]); 
         ......

RESPONSE:
data: {“statuses”:[],“search_metadata”:{“completed_in”:0.049,“max_id”:666770690968788992,“max_id_str”:“666770690968788992”,“query”:"%2523qa%2520-%2523sex-%2523xxx-%2523porn-%2523adult-%2523fuck-%2523ass±filter%3Aretweets",“refresh_url”:"?since_id=666770690968788992&q=%2523qa%2520-%2523sex-%2523xxx-%2523porn-%2523adult-%2523fuck-%2523ass%20-filter%3Aretweets&lang=en-US&result_type=mixed&include_entities=1",“count”:20,“since_id”:0,“since_id_str”:“0”}}

But, the same request using iOS 8 simulator is working and if i use iOS 9 the response is as above.

I have spent days trying to figure this out, can someone please guide me in the right direction

  • Harshal

#2