Reputation: 182
The design checklist for "Sender stops cast" states
When the last or only sender is connected to a receiver, tapping Disconnect stops the app running on the receiver[...]
On iOS, GCKDeviceManager
leaveApplication
and stopApplication
respectively leave the app or kill it but with no regards for other senders being connected or not.
How does a sender know it's the last one connected?
Edit: I'm not using the custom receiver
Upvotes: 2
Views: 142
Reputation: 19094
Right now you will need to have your own receiver (i.e. custom receiver) to do that and use the api that Angel had mentioned. In future, we plan to update the Styled Receiver to include that logic. In fact, right now, you cannot distinguish between an explicit or implicit disconnect, so if you want to implement the disconnection logic correctly, you have to use a custom receiver and use a custom namespace to send a message to the receiver when an explicit disconnect is attempted. Next release will address that issue as well.
Upvotes: 0
Reputation: 93
You can do it within your receiver with castReceiverManager.getSenders().length
Upvotes: 0