title: Custom notification with Google Cast SDK v3
body: <p>Ever since the new <em>Google Cast SDK v3</em> has been out, I've been thinking about migrating to it, as it has a few features I need and I'm always interested in keeping everything as up-to-date as possible. My previous setup used <em>Google Cast SDK v2 + Cast Companion Library</em>. However I've been unable to find a way to provide a completely custom notification in the new <em>Google Cast SDK v3</em> which prevents me from using it.</p>
  
  <p>With <em>Google Cast SDK v2 + Cast Companion Library</em> I was able to simply subclass the <code>VideoCastNotificationService</code> and override its <code>build</code> method to make a custom notification:</p>
  
  <pre><code>public class MyCastNotificationService extends VideoCastNotificationService {
      @Override
      protected void build(MediaInfo info, Bitmap bitmap, boolean isPlaying) {
          // ... build the custom notification
          mNotification = new NotificationCompat.Builder(this)/*...*/.build();
      }
  }
  </code></pre>
  
  <p>Then I could register the <code>MyCastNotificationService</code> in my <code>CastConfiguration</code> like this:</p>
  
  <pre><code>CastConfiguration castConfig = new CastConfiguration.Builder(APPLICATION_ID)
      /*...*/
      .setCustomNotificationService(MyCastNotificationService.class)
      .build();
  </code></pre>
  
  <p>However, with <em>Google Cast SDK v3</em> I've been unable to find a replacement that works. Here are the results of the bit of research I've done on this topic:</p>
  
  <ul>
  <li>The <a href="https://developers.google.com/cast/docs/reference/android/com/google/android/gms/cast/framework/media/MediaNotificationService"><code>MediaNotificationService</code></a> seems to be the component replacing the <code>VideoCastNotificationService</code>, however it does not seem to have a <code>build</code> method or anything similiar.</li>
  <li>Both the <a href="https://developers.google.com/cast/docs/reference/android/com/google/android/gms/cast/framework/media/NotificationOptions.Builder"><code>NotificationOptions.Builder</code></a> and <a href="https://developers.google.com/cast/docs/reference/android/com/google/android/gms/cast/framework/media/CastMediaOptions.Builder"><code>CastMediaOptions.Builder</code></a> classes don't seem to have any methods for registering a custom notification service.</li>
  <li>The only documented way of customizing the notification seems to be custom action buttons as shown in the <a href="https://developers.google.com/cast/docs/android_sender_integrate#add_media_controls_to_notification_and_lock_screen">Add Media Controls to Notification and Lock Screen</a> section, however I need to create a notification using the <code>RemoteViews</code> API, so this is not sufficient for me.</li>
  </ul>
  
  <p>Has anyone been able to provide a custom notification using the new <em>Google Cast SDK v3</em>? As far as I can tell, this seems unsupported, but I'd love to be proven wrong here. Thanks in advance!</p>