From 3049f778fa2fc3b1d9c281fe9816c261071f6185 Mon Sep 17 00:00:00 2001 From: "Jung-Yu (Gina) Yeh" Date: Tue, 1 May 2018 20:51:23 -0700 Subject: [PATCH] Replace deprecated functions with new API in v4.2.0 --- Classes/AppDelegate.m | 8 +++++--- Classes/MediaTableViewController.m | 2 +- Classes/MediaViewController.m | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Classes/AppDelegate.m b/Classes/AppDelegate.m index 94aebd2..fd37c6b 100644 --- a/Classes/AppDelegate.m +++ b/Classes/AppDelegate.m @@ -62,8 +62,10 @@ - (BOOL)application:(UIApplication *)application // is also available _useCastContainerViewController = NO; + GCKDiscoveryCriteria *discoveryCriteria = + [[GCKDiscoveryCriteria alloc] initWithApplicationID:applicationID]; GCKCastOptions *options = - [[GCKCastOptions alloc] initWithReceiverApplicationID:applicationID]; + [[GCKCastOptions alloc] initWithDiscoveryCriteria:discoveryCriteria]; [GCKCastContext setSharedInstanceWithOptions:options]; [GCKCastContext sharedInstance].useDefaultExpandedMediaControls = YES; @@ -133,8 +135,8 @@ - (void)applicationWillTerminate:(UIApplication *)application { - (void)setupCastLogging { GCKLoggerFilter *logFilter = [[GCKLoggerFilter alloc] init]; - logFilter.exclusive = YES; - [logFilter addClassNames:@[ + [logFilter setLoggingLevel:GCKLoggerLevelVerbose + forClasses:@[ @"GCKDeviceScanner", @"GCKDeviceProvider", @"GCKDiscoveryManager", diff --git a/Classes/MediaTableViewController.m b/Classes/MediaTableViewController.m index a6d9e4a..29439bf 100644 --- a/Classes/MediaTableViewController.m +++ b/Classes/MediaTableViewController.m @@ -104,7 +104,7 @@ - (void)castDeviceDidChange:(NSNotification *)notification { if ([GCKCastContext sharedInstance].castState != GCKCastStateNoDevicesAvailable) { // You can present the instructions on how to use Google Cast on // the first time the user uses you app - [[GCKCastContext sharedInstance] presentCastInstructionsViewControllerOnce]; + [[GCKCastContext sharedInstance] presentCastInstructionsViewControllerOnceWithCastButton:_castButton]; } } diff --git a/Classes/MediaViewController.m b/Classes/MediaViewController.m index 362b072..3c00dbe 100644 --- a/Classes/MediaViewController.m +++ b/Classes/MediaViewController.m @@ -104,7 +104,7 @@ - (void)castDeviceDidChange:(NSNotification *)notification { if ([GCKCastContext sharedInstance].castState != GCKCastStateNoDevicesAvailable) { // You can present the instructions on how to use Google Cast on // the first time the user uses you app - [[GCKCastContext sharedInstance] presentCastInstructionsViewControllerOnce]; + [[GCKCastContext sharedInstance] presentCastInstructionsViewControllerOnceWithCastButton:_castButton]; } }