Using the iOS Sender API Framework, when my application goes in the background, the SDK tears down all connections and I cannot launch any more media until the app is put back in the foreground. My app plays audio and is allowed to run and stream in the background. Is there an option to tell Googlecast framework to keep the sockets opened?
Here's the log on backgrounding:
INFO: Will resign active
INFO: Now in background
FINE: -[GCKCastSocket disconnect] disconnect
FINE: -[GCKCastSocket doTeardownWithError:] doTeardownWithError
FINE: -[GCKCastSocket doTeardownWithError:] notifying delegate that socket is disconnected
FINE: -[GCKHeartbeatChannel didDisconnect] disconnected - stopping heartbeat timer if necessary
FINE: -[GCKCastSocket socketDidDisconnect:withError:] socketDidDisconnect:withError: "(null)"
Then when the app resumes: INFO: Going into foreground
FINE: -[GCKCastSocket doTeardownWithError:] doTeardownWithError
FINE: -[GCKCastSocket doTeardownWithError:] notifying delegate that socket is disconnected
FINE: -[GCKCastSocket connectToHost:port:withTimeout:] Connecting to "192.168.1.4" on port 8009l...
INFO: Did become active
FINE: -[GCKCastSocket socket:didConnectToHost:port:] socketDidConnect:
FINE: -[GCKCastSocket socketDidSecure:] socketDidSecure:
FINE: -[GCKCastSocket socket:didReadData:withTag:] prefix read, expected message length=1307
FINE: -[GCKDeviceAuthChannel didReceiveBinaryMessage:] Genuine Google device didDeviceAuthenticated=YES
FINE: -[GCKDeviceManager deviceAuthChannelDidAuthenticate:] Authentic device, connecting receiver channel
FINE: -[GCKCastSocket socket:didReadData:withTag:] prefix read, expected message length=474
FINE: -[GCKDeviceManager receiverControlChannel:didReceiveStatusForApplication:] Application to join (CC1AD845) is available
FINE: -[GCKDeviceManager connectAndNotifyDidConnectToApplication:launchedApplication:] Connected to application <0x1467c8f0:GCKApplicationMetadata> Default Media Receiver (CC1AD845), transport ID web-11
FINE: -[GCKCastSocket socket:didReadData:withTag:] prefix read, expected message length=135
FINE: -[GCKMediaControlChannel didReceiveTextMessage:] message received: {"type":"MEDIA_STATUS","status":[],"requestId":6}