doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.25k stars 1k forks source link

Can't not receive url deeplink IOS when click on notification metadata #2260

Closed vietdung97 closed 3 months ago

vietdung97 commented 7 months ago

Describe the Bug Hi everyone, I can't get url data from Link on iOS when I click on the metadata notification like Android (Android works perfectly) So, how do I get the string "trackplayer://notification.click" like Android? Code To Reproduce

  useEffect(() => {
    async function deepLinkHandler(data: {url: string | null}) {
      if (data.url === 'trackplayer://notification.click') {
        //
      }
    }

    const listener = Linking.addEventListener('url', deepLinkHandler);

    Linking.getInitialURL().then(url => deepLinkHandler({url}));

    return () => {
      listener.remove();
    };
  }, []);
=> nothing happens on callback function of listener

Environment Info: Paste the exact react-native-track-player version you are using: 4.0.1 Real device What OS are you running: IOS 17

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 7 days with no activity.