The Google Cast SDK includes API libraries and sample application code to help your applications go big. These APIs are documented in the API references, and the sample code is discussed in the Android, iOS, and Web Sender and the Receiver app guides.
Here's what you need to build a Cast app.
A sender application, written for the Android, iOS, or Cast-supported web platforms, which uses the following Cast APIs:
A Receiver application that handles communication between the sender app and the Cast device. You have the following options:
- The Default Media Receiver presented with the Google Cast branding and styling.
- The Styled Media Receiver for which you can develop the styles and branding. See Styled Media Receiver.
- A custom receiver, as described in Custom receiver implements the Web Receiver SDK, and it handles custom messages from your sender app.
- Another option is the Android TV Receiver.
How you implement your receiver may depend upon which media types your application needs to support.
In accordance with the Google Cast SDK Additional Developer Terms of Service, a Cast media application must use the Media Playback Messages defined for the SDK to control media playback on the receiver. Doing so provides the media app with a consistent user experience across platforms and it ensures that a Cast application will support new and future use cases. These structures also support custom data, where appropriate, and an application may define its own messages for commands not supported by the SDK.
Setup for development
For all Google Cast devices, do the following:
Install your Cast device and run through the setup instructions.
For Chromecast devices, get the Google Home app. For other devices, see the manufacturer's instructions.
Run the Google Home app (for a phone or tablet) on your sender device, following the setup prompts as directed.
Register your Google Cast device at the Google Cast SDK Developer Console.
You must register the device so that you can use it for testing. See Devices for more information about registering devices.
For Android TV, see Android TV with Google Cast.
For Google Cast for audio devices, see Audio Devices.
Review the User Experience Guidelines showing you how to implement a UI that is consistent with other Cast apps.
Get the API libraries for sender and receiver apps.
Try the Sample Apps to help you get started.
Register your application.
You will receive an app ID to include with your API calls.
Develop your app.
Install API libraries
The Google Cast SDK and API libraries support the development of Android, iOS, and Web Sender apps, and the development of Android Receiver and Web Receiver apps.
iOS Sender API library
Follow the setup instructions to get started with the iOS Sender API.
Libraries without guest mode have been provided for situations where your app does not require the feature or you do not wish to require Bluetooth® permissions, which have been introduced in iOS 13. Please see the iOS 13 Changes document for more information.
Download the Cast 4.6.1 iOS Sender API libraries:
GoogleCast.framework in your project, and select Show In Finder.
into the top-level directory of your Xcode project. When prompted, ensure Copy items into
destination group's folder is NOT selected.
Android Sender API library
Follow the setup instructions to get started with the Android Sender API.
Web Sender API library
Follow the setup instructions to get started with the Web Sender API.
Android TV Receiver API library
Follow the setup instructions to get started with the Android Receiver API.
Web Receiver API library
The Web Receiver SDK includes an API which is available to the Web Receiver application once you register your receivers and devices for development. Follow the setup instructions to get started with the Web Receiver API.
Download Cast icons
This file includes both bitmaps and vectors for the icons. These are also included with the Android v7mediarouter library.