Connecting to Apple Music

我是研究僧i 提交于 2020-06-27 16:46:08

问题


So Im trying to connect to Apple Music from an iOS device using a react native application, There is an API present for doing the same but I need to call a function from the storekit framework ? to make personalised requests.

Apple Music API : https://developer.apple.com/documentation/applemusicapi

Function to be called : https://developer.apple.com/documentation/storekit/skcloudservicecontroller/2909079-requestusertoken

Im not sure how to go about this, I'm a beginner at React Native, could you guys help me out

UPDATE:

So I figured I need to make use of something known as React Native Modules ?

More here : https://facebook.github.io/react-native/docs/native-modules-ios#content

still trying things out, please feel free to add or correct me, this is still a work in progress


回答1:


Okay so i finally figured this out,

I had to create functions on Objective-C and pass them over to React native using the RNBridge, explained more in 'Native Modules'

So i had to create functions for checking authorization and requesting authorization, and a function to get the User Personalized Music Token,

The developer token used was encrypted on my back-end that is running on python



来源:https://stackoverflow.com/questions/54503551/connecting-to-apple-music

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!