Skip to content

Commit

Permalink
Replace deprecated functions with new API in v4.2.0
Browse files Browse the repository at this point in the history
ginayeh committed May 2, 2018
1 parent 07bda58 commit 3049f77
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Classes/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -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",
2 changes: 1 addition & 1 deletion Classes/MediaTableViewController.m
Original file line number Diff line number Diff line change
@@ -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];
}
}

2 changes: 1 addition & 1 deletion Classes/MediaViewController.m
Original file line number Diff line number Diff line change
@@ -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];
}
}

0 comments on commit 3049f77

Please sign in to comment.