Search code examples
androidchromecastgoogle-castcustom-receiver

Google Cast - Sample Android app not showing Cast icon if I change App ID


I'm working with the CastHelloText-android project from Googlecast Github because I want to understand how the messages between the Sender and the (Chrome)cast Receiver works.

I registered my device (Console says Ready for Testing). I checked out mentioned project from Github. I've tested it on my Android phone with my Chromecast. Everything worked ok. I can connect and speak to the phone and when I finish the TV screen is updated with what I said. Nice.

I saw that this project uses the App ID 79####BF. I also saw that there's one folder that contains the receiver.html Custom Receiver. I opened it and it seems taht there's no reference to that App ID so I left as is and then I uploaded that HTML file to my Google Drive.

Then, I went to Cast Developers Console and I created a new Application with Custom Receiver and name Cast Hello Text. For the Receiver I provided exactly that URL from Google Drive. They gave me an App ID 8A####7E which I put into the App ID string, replacing the mentioned above.

What would you expect from this? Personally I was expecting that everything worked exactly equals as with the original App ID but with the only difference that is hosted in another site. But no! With this App ID I can't see the Cast icon. But if I go back again to original ID then it appears.

I can't find an answer. I've been dealing with this for long hours so I decided ask here. I don't know what I'm doing wrong. I didn't touch anything from the code.

I'll put code pieces if necessary, but I gave the links to entire Github project and I consider that is not necessary.


Solution

  • First, the way you have exposed your receiver in your google drive is incorrect; when you correctly expose the receiver using goole drive, it should look like: https://www.googledrive.com/host/[doc-id]. Here is a set of instructions to do that. Secondly, to have an unpublished app visible on your cast device, you need to follow the steps outlined here, specially look under the section Devices (step 3 is a common issue, take a photo to ensure you are entering the right serial number, also make sure you have done step 6 as well).

    Update: Google Drive is no longer a viable hosting place for receivers.