PhilipsHue / PhilipsHueSDK-iOS-OSX

The Software Development Kit for Philips Hue on iOS and OS X (beta)
579 stars 169 forks source link

Operations called on background thread do nothing #78

Open alistairg opened 9 years ago

alistairg commented 9 years ago

I've been fighting the following swift code. It's called in the background, and didn't do anything (notifications registered elsewhere are never called). However, if I run it on the main thread, it works fine.

This should work on a background thread too, no?

let hueSdk = PHHueSDK() hueSdk.enableLogging(true) hueSdk.startUpSDK() NSLog("Server: Attempting to link with Hue hub at \(request.ipAddress) with MAC \(request.macAddress)") hueSdk.setBridgeToUseWithIpAddress(request.ipAddress, macAddress: request.macAddress) hueSdk.startPushlinkAuthentication()