From e343fee924e337971bc989f05318983f6bb684c5 Mon Sep 17 00:00:00 2001 From: Lindsay-Needs-Sleep Date: Tue, 21 Jan 2020 15:40:54 -0700 Subject: [PATCH] (ios) Fix https://github.com/miloproductionsinc/cordova-plugin-chromecast/issues/6 This should have been fixed with https://github.com/miloproductionsinc/cordova-plugin-chromecast/issues/5 but the test that covered this case was effectively skipped. So the test now works properly and you can control the media after an app restart. --- src/ios/ChromecastSession.m | 4 +++- tests/www/js/tests_manual_primary_1.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ios/ChromecastSession.m b/src/ios/ChromecastSession.m index 665c400..fa1d9cb 100644 --- a/src/ios/ChromecastSession.m +++ b/src/ios/ChromecastSession.m @@ -337,7 +337,9 @@ - (void)sessionManager:(GCKSessionManager *)sessionManager didResumeCastSession: // ios randomly resumes current session, don't trigger SESSION_LISTENER in this case return; } - [self setSession:session]; + // Do all the setup/configuration required when we get a session + [self sessionManager:sessionManager didStartCastSession:session]; + // trigger the SESSION_LISTENER event [self.sessionListener onSessionRejoin:[CastUtilities createSessionObject:session]]; } diff --git a/tests/www/js/tests_manual_primary_1.js b/tests/www/js/tests_manual_primary_1.js index 6f3ec49..20f7d83 100644 --- a/tests/www/js/tests_manual_primary_1.js +++ b/tests/www/js/tests_manual_primary_1.js @@ -296,7 +296,6 @@ { id: session_listener, repeats: false } ], function () { finished = true; - utils.storeValue(cookieName, ++runningNum); done(); }); var apiConfig = new chrome.cast.ApiConfig(