简体   繁体   中英

React native app detect background apps activity

I want to achieve this scenario: when user opnened my app, then he play a song in Spotify, my app can get title of the song. Is it possible to build an app like that with react native?

You can try without any library. Just using the Spotify API to capture the user current song.

https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/

If you want to have always update in your state, try to create a listener function that in times request to this spotify API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM