I am able to fetch recently played songs from Apple Music using MPMediaQuery
and MPMediaItem
.
But this is giving me songs list which are locally downloaded in my music app.
I'm not able to fetch songs those which are not downloaded and those I am playing from Apple Music. Is there any way to do so?
I did a lot R&D for this today and found:
https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/GetRecentlyPlayed.html#//apple_ref/doc/uid/TP40017625-CH62-SW1
Followed almost every step but stuck on JWT token generation. Also after generating JWT token what's next? I am not getting any link or something which could help me to do this step by step. Also having one more question, whether this API calling help me out to fetch recently played songs which are not downloaded and just played online in Apple music app?
If anyone could help me to achieve this please! Thanks in advance.