{"action":"created","issue":{"url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/4","repository_url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin","labels_url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/4/comments","events_url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/4/events","html_url":"https://github.com/kean/Nuke-Alamofire-Plugin/issues/4","id":147131024,"number":4,"title":"Issue with AlamofireNetworkActivityIndicator?","user":{"login":"winkelsdorf","id":1413291,"avatar_url":"https://avatars.githubusercontent.com/u/1413291?v=3","gravatar_id":"","url":"https://api.github.com/users/winkelsdorf","html_url":"https://github.com/winkelsdorf","followers_url":"https://api.github.com/users/winkelsdorf/followers","following_url":"https://api.github.com/users/winkelsdorf/following{/other_user}","gists_url":"https://api.github.com/users/winkelsdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/winkelsdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winkelsdorf/subscriptions","organizations_url":"https://api.github.com/users/winkelsdorf/orgs","repos_url":"https://api.github.com/users/winkelsdorf/repos","events_url":"https://api.github.com/users/winkelsdorf/events{/privacy}","received_events_url":"https://api.github.com/users/winkelsdorf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2016-04-09T13:56:14Z","updated_at":"2016-09-18T19:41:42Z","closed_at":"2016-04-15T10:26:16Z","body":"I am trying to route all traffic through Alamofire, for testing I have this in AppDelegate's  ```didFinishLaunchingWithOptions```:\r\n\r\n```\r\n        // Automatically show Network Activity Indicator when using Alamofire\r\n        NetworkActivityIndicatorManager.sharedManager.startDelay = 0\r\n        NetworkActivityIndicatorManager.sharedManager.isEnabled = true\r\n\r\n        // Redirect Nuke through Alamofire, but use an additional alamoFireManager\r\n        // TODO: Move to Extension..\r\n        let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()\r\n        configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders\r\n\r\n        let alamoFireManager = Manager.init(configuration: configuration)\r\n        let dataLoader: ImageDataLoading = AlamofireImageDataLoader(manager: alamoFireManager)\r\n        ImageManager.shared = ImageManager(configuration: ImageManagerConfiguration(dataLoader: dataLoader))\r\n```\r\n\r\nNuke is correctly using the ```alamoFireManager``` in it's calls.\r\n\r\nBut the NetworkActivityIndicatorManager does not work, no Notifications are sent by Alamofire for .resume.\r\n\r\nIn Alamofire Request.swift I set a breakpoint for resume() \r\n```\r\n    public func resume() {\r\n        if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() }\r\n\r\n        task.resume()\r\n        NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task)\r\n    }\r\n```\r\n\r\nThe call to ```postNotificationName()``` is never reached. I did issue a ```        nk_imageLoadingController.manager.removeAllCachedImages()``` before using ```nk_setImageWith()``` and also tried resetting the simulator.\r\n\r\nEdit:\r\nEven with dataLoad set to AlamoFire, Nuke's execute() in Internal.swift uses NSURLSession\r\n```\r\n    func execute() {\r\n        executing = false\r\n        if let task = pendingTasks.firstObject as? NSURLSessionTask where executingTasks.count < maxExecutingTaskCount {\r\n            pendingTasks.removeObjectAtIndex(0)\r\n            executingTasks.insert(task)\r\n            task.resume() // points to NSURLSession\r\n            setNeedsExecute()\r\n        }\r\n    }\r\n```\r\n\r\nAny idea what's going on?"},"comment":{"url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/comments/247869352","html_url":"https://github.com/kean/Nuke-Alamofire-Plugin/issues/4#issuecomment-247869352","issue_url":"https://api.github.com/repos/kean/Nuke-Alamofire-Plugin/issues/4","id":247869352,"user":{"login":"kean","id":1567433,"avatar_url":"https://avatars.githubusercontent.com/u/1567433?v=3","gravatar_id":"","url":"https://api.github.com/users/kean","html_url":"https://github.com/kean","followers_url":"https://api.github.com/users/kean/followers","following_url":"https://api.github.com/users/kean/following{/other_user}","gists_url":"https://api.github.com/users/kean/gists{/gist_id}","starred_url":"https://api.github.com/users/kean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kean/subscriptions","organizations_url":"https://api.github.com/users/kean/orgs","repos_url":"https://api.github.com/users/kean/repos","events_url":"https://api.github.com/users/kean/events{/privacy}","received_events_url":"https://api.github.com/users/kean/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T19:41:42Z","updated_at":"2016-09-18T19:41:42Z","body":"@winkelsdorf `AlamofireNetworkActivityIndicator` just works now. Nuke 4 uses `resume()` and `cancel()` methods of `Alamofire.Request` like it should. I hope to release Nuke 4.0 today/tomorrow. In the meantime it would be great if you could test this with current beta (Nuke 4.0-beta3)."}}
{"actor":{"display_login":"kean"}}