In my sender app I'm using
ApplicationMetadata metadata = Cast.CastApi.getApplicationMetadata(apiClient);
while
apiClient.isConnected()
returns true and my receiver app is running on the Chromecast. When I do this, the method always returns null so the metadata object is always set to null. Is there anything else I need to do for this to work?
Thanks in advance
There seems to be a bug there which will be addressed in the next release. Meanwhile, note that when you call
Cast.CastApi.launchApplication()
orCast.CastApi.joinApplication()
, you get aPendingResult
object. You can set a callback on that to be notified of the result of your call; theonResult()
method will be called and anApplicationConnectionResult
object will be passed to it. You can callgetApplicationMetadata()
on that object and that works fine (assuming you successfully launch or join an application).