From 8fa1434b3cb6d94fc41df9639257eaf706c3b22d Mon Sep 17 00:00:00 2001 From: William Van Haevre Date: Tue, 29 Oct 2024 17:26:40 +0100 Subject: [PATCH 1/2] Only clear nowPlayingInfo when no new metadata is provided. --- ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift b/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift index 294d106d0..d72e49508 100644 --- a/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +++ b/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift @@ -44,7 +44,6 @@ class THEOplayerRCTNowPlayingManager { func updateNowPlaying() { // Reset any existing playing info self.nowPlayingInfo = [:] - self.clearNowPlayingOnInfoCenter() // Gather new playing info if let player = self.player, @@ -66,13 +65,19 @@ class THEOplayerRCTNowPlayingManager { self.updateArtWork(artWorkUrlString) { [weak self] in self?.processNowPlayingToInfoCenter() } + } else { + self.clearNowPlayingOnInfoCenter() } } private func processNowPlayingToInfoCenter() { let nowPlayingInfo = self.nowPlayingInfo DispatchQueue.main.async { - MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo + if !nowPlayingInfo.isEmpty { + MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo + } else { + MPNowPlayingInfoCenter.default().nowPlayingInfo = nil + } } } From 979c1fd265ff223a1783901f82446316842a7e26 Mon Sep 17 00:00:00 2001 From: William Van Haevre Date: Tue, 29 Oct 2024 17:55:29 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdce46842..8afe08cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fixed an issue on iOS where the dynamic island (iphone 14 plus and higher) briefly disappeared when updating the nowPlayingInfo on for example backgrounding the app. - Fixed an issue on Android when using Expo, where the Expo plugin would not add THEOplayer's Maven repo to the project's repositories list. ## [8.6.0] - 24-10-25