oralodabas / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

GCKCastChannel.sendTextMessage returns a false when called in background mode of an iOS app #546

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Create an iOS app that will run in the background (ie. run a silent audio 
loop to do this)
2.  Make sure the app is connected to a chromecast before going to background 
mode
3.  Go to background mode with a loop that continually calls sendTextMessage 
from the cast SDK

What is the expected output? What do you see instead?
sendTextMessage should return true when in background mode as it is when in 
foreground mode.  However sendTextMessage is returning false during background 
mode

What version of the product are you using? On what operating system?
iOS Cast sdk v 2.5.1

Please provide any additional information below.
We want to provide access for control when the phone is locked

Original issue reported on code.google.com by ji...@haystack.tv on 23 Mar 2015 at 10:09

GoogleCodeExporter commented 9 years ago
Tried this with Cast SDK v 2.6.0 as well and happens there too

Original comment by ji...@haystack.tv on 23 Mar 2015 at 10:27

GoogleCodeExporter commented 9 years ago
The socket is closed on iOS when the app is on the background. Therefore 
implementing lock screen controls on iOS is not possible.

See: http://stackoverflow.com/a/22611886/1952815

Original comment by nchourr...@gmail.com on 24 Mar 2015 at 3:05

GoogleCodeExporter commented 9 years ago
It would be great if google could change that and make it configurable

Original comment by j22c...@gmail.com on 24 Mar 2015 at 7:20

GoogleCodeExporter commented 9 years ago
Set the ignoreAppStateNotifications parameter of the GCKDeviceManager 
initializer to YES. Then the SDK won't listen for app 
foregrounding/backgrounding events and thus won't automatically disconnect when 
app goes into background; you'll be on your own as far as handling these events.

Original comment by mlind...@google.com on 25 Mar 2015 at 7:41

GoogleCodeExporter commented 9 years ago

Original comment by jonathan...@google.com on 26 Mar 2015 at 5:02

GoogleCodeExporter commented 9 years ago
that did work!

Original comment by j22c...@gmail.com on 3 Apr 2015 at 11:39