Music-user-token and apple music data through apple id login

152 Views Asked by At

I am creating a React-native application. I want to get user's data from his Apple Music account.

I tried two ways,

  1. I created a html page with a login button and user Apple Music Kit in it and when hits connecting his/her Apple Music Account on frontend, this html page is send back as response. On frontend, we are opening this page in webview. (expected behaviour: when I click loign button, a popup should open where i need to login to apple music and good to go. this is working fine with react (web app)); but in the react-native, when i click login button, it doesn't open popup there.
  2. I registered an AppId on Apple Developer's portal and attach a MusicKit service to it; created an Private key as well. According to documentation (the best to my understanding), the access_token I get by loggin in to apple, same token can be used as Music-user-token to access my data on apple music account. But when call an apple music api with this access_token along with apple developer token it gives me error 403: Forbidden.

Can someone help me out in any of the approach and which one is the better approach.

0

There are 0 best solutions below