I'm trying to implement a custom Google search in IOS. For testing, I'm trying to test the request in a Playground. My search URL works fine in the browser (chrome), however in the playground the completion block isn't firing and I'm getting this in the console: (even after restarting Xcode)
2016-02-01 17:00:07.059 GooglePlayground[23603:5654691]
Failed to obtain sandbox extension for path=
/var/folders/1q/fvvgmbxd7zvbl2s0d307pb8m0000gn/T/com.apple.dt.Xcode.pg/containers/com.apple.dt.playground.stub.iOS_Simulator.GooglePlayground-8B924AAB-7245-42E2-8771-B5E36703E579/Library/Caches/com.apple.dt.playground.stub.iOS_Simulator.GooglePlayground-8B924AAB-7245-42E2-8771-B5E36703E579.
Errno:1
Code:
import UIKit
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
let SearchEngineID = "XXXXX"
let APIKey = "XXXXX"
let searchText = "steelers"
let googleURL = "https://www.googleapis.com/customsearch/v1?q=" + searchText + "&key=" + APIKey + "&cx=" + PinCheckSearchEngineID
var nsURL = NSURL(string: googleURL)
let session = NSURLSession.sharedSession()
let task = session.dataTaskWithURL(nsURL!, completionHandler: {(data, response, error) in
print("data = \(data)")
})
task.resume()