我试图在POST,GET等后台进行调用,以便在didReceiveRemoteNotification方法中更精确,因为它们开始作为推送通知到达.我的问题是,在我打开应用程序之前,所有Alamofire.request都不会在后台模式中调用.我现在有
我试图打开一个会话,但它不会使请求工作.
这些是我想在后台执行的(后台手机)
Alamofire.Manager(configuration: configuration).request(.GET, url, parameters: nil)
.responseJSON { (_, _, JSON, _) in
//println(JSON)
println(JSON)
REST OF THE CODE
Run Code Online (Sandbox Code Playgroud)
但是它不会起作用,即使我在这些请求下面添加代码也可以工作,但是请求的返回甚至是请求都没有.
uiapplicationdelegate swift background-task alamofire backgroundtaskidentifier