Skip to content

clearNowPlayingMetadata clears metadata, but never comes back #1653

@DennisdeWitNL

Description

@DennisdeWitNL

Describe the Bug
After clearing the now playing metadata by clearNowPlayingMetadata, every new track added, will not show the metadata anymore, unless you fully restart the app after forcing the app to stop. This is an Android issue.

Steps To Reproduce

  1. Download my example here: https://github.com/DennisdeWitNL/example-clearmetadata
  2. Play the song. Check the metadata in the notification control center. It is there.
  3. Now pause the song and check the metadata. It is still there.
  4. Now click Clear Metadata. The metadata has been cleared.
  5. Now click Queue and then click Play. There is still no metadata, unless you fully restart the app and stop the service.

Code To Reproduce
Please download my edited example here: https://github.com/DennisdeWitNL/example-clearmetadata

Environment Info:
Paste the results of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.93 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - ~/Documents/Apps/node_modules/.bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.0, iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 14.0/14A5270f - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.3.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.1 => 0.68.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found


Paste the exact react-native-track-player version you are using

react-native-track-player@3.0.0
Real device? Or simulator?
Both

What OS are you running?
macOS Ventura with Android Studio, the latest SDK. Also fails on a Samsung Galaxy S10 Ultra

How I can Help
What can you do to help resolve this?
Have you investigated the underlying JS or Swift/Android code causing this bug?
Can you create a Pull Request with a fix?

There is no log in Logcat, therefore I don't know where to start. Willing to test a PR of course!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions