PhilipsHue / PhilipsHueSDK-iOS-OSX

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

Could not connect to bridge #97

Closed bgjehu closed 9 years ago

bgjehu commented 9 years ago

Using the hue app, I connect to bridge and control hue light bulb perfectly fine. However, when I tried to use my own app following the api guide (http://www.developers.meethue.com/documentation/apple-api-guide) to connect to the bridge, it's not working. So I tried the quickstart app, and it is not connect to the bridge either with these following logged. And I remember I got similar message under my own app. And I have no clue how to fix it. Please help. Thank you!

2015-07-30 12:55:26.386 HueQuickStartApp-iOS[1560:544901] Allocating PHCLIPWrapper 2015-07-30 12:55:26.388 HueQuickStartApp-iOS[1560:544901] Allocating PHHttpRequester 2015-07-30 12:55:26:389 HueQuickStartApp-iOS[1560:b07] HTTP Request: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Method: GET Body: 2015-07-30 12:55:26.398 HueQuickStartApp-iOS[1560:544901] HangTracer interval is 0, forcing to 1s 2015-07-30 12:55:26.509 HueQuickStartApp-iOS[1560:544969] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. 2015-07-30 12:55:26:515 HueQuickStartApp-iOS[1560:b07] HTTPConnection failed (code=0): The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. http://10.0.0.42/api/gKVA60VH0A2ljOtu/config 2015-07-30 12:55:26:515 HueQuickStartApp-iOS[1560:b07] HTTP Response: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Code: 0 Body: 2015-07-30 12:55:26:516 HueQuickStartApp-iOS[1560:b07] Error occured while fetching inital config for full bridge config: Error Domain=com.philips.hue.sdk Code=21 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x12d531a10 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSErrorFailingURLStringKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config}}, NSErrorFailingURLStringKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSErrorFailingURLKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.} 2015-07-30 12:55:36.568 HueQuickStartApp-iOS[1560:544901] Allocating PHHttpRequester 2015-07-30 12:55:36:569 HueQuickStartApp-iOS[1560:b07] HTTP Request: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Method: GET Body: 2015-07-30 12:55:36.571 HueQuickStartApp-iOS[1560:544901] Deallocating PHHttpRequest

xylys commented 9 years ago

Are you developing for ios 9?

Disable app transport security.  To do this, add the following to your info.plist

`

NSAppTransportSecurity
 <dict>  
      <key>NSAllowsArbitraryLoads</key><true/>  
 </dict>  

`

On Thu, Jul 30, 2015 at 8:06 PM, Jieyi Hu notifications@github.com wrote:

Using the hue app, I connect to bridge and control hue light bulb perfectly fine. However, when I tried to use my own app following the api guide (http://www.developers.meethue.com/documentation/apple-api-guide) to connect to the bridge, it's not working. So I tried the quickstart app, and it is not connect to the bridge either with these following logged. And I remember I got similar message under my own app. And I have no clue how to fix it. Please help. Thank you! 2015-07-30 12:55:26.386 HueQuickStartApp-iOS[1560:544901] Allocating PHCLIPWrapper 2015-07-30 12:55:26.388 HueQuickStartApp-iOS[1560:544901] Allocating PHHttpRequester 2015-07-30 12:55:26:389 HueQuickStartApp-iOS[1560:b07] HTTP Request: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Method: GET Body: 2015-07-30 12:55:26.398 HueQuickStartApp-iOS[1560:544901] HangTracer interval is 0, forcing to 1s 2015-07-30 12:55:26.509 HueQuickStartApp-iOS[1560:544969] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. 2015-07-30 12:55:26:515 HueQuickStartApp-iOS[1560:b07] HTTPConnection failed (code=0): The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. http://10.0.0.42/api/gKVA60VH0A2ljOtu/config 2015-07-30 12:55:26:515 HueQuickStartApp-iOS[1560:b07] HTTP Response: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Code: 0 Body: 2015-07-30 12:55:26:516 HueQuickStartApp-iOS[1560:b07] Error occured while fetching inital config for full bridge config: Error Domain=com.philips.hue.sdk Code=21 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x12d531a10 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSErrorFailingURLStringKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config}}, NSErrorFailingURLStringKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSErrorFailingURLKey=http://10.0.0.42/api/gKVA60VH0A2ljOtu/config, NSLocalizedDescription=The resource could not be loaded because the App Transp ort Security policy requires the use of a secure connection.} 2015-07-30 12:55:36.568 HueQuickStartApp-iOS[1560:544901] Allocating PHHttpRequester 2015-07-30 12:55:36:569 HueQuickStartApp-iOS[1560:b07] HTTP Request: URL: http://10.0.0.42/api/gKVA60VH0A2ljOtu/config Method: GET Body:

2015-07-30 12:55:36.571 HueQuickStartApp-iOS[1560:544901] Deallocating PHHttpRequest

Reply to this email directly or view it on GitHub: https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX/issues/97

bgjehu commented 9 years ago

Yes, I am. It works now! Thank you so much!