连接到 Apple Music [英] Connecting to Apple Music
问题描述
所以我尝试使用 React Native 应用程序从 iOS 设备连接到 Apple Music,有一个 API 可以做同样的事情,但我需要从 storekit 框架调用一个函数?提出个性化请求.
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
Apple Music API : https://developer.apple.com/documentation/applemusicapi
要调用的函数:https://developer.apple.com/文档/storekit/skcloudservicecontroller/2909079-requestusertoken
我不知道该怎么做,我是 React Native 的初学者,你们能帮帮我吗
Im not sure how to go about this, I'm a beginner at React Native, could you guys help me out
更新:
所以我想我需要使用称为 React Native Modules 的东西?
So I figured I need to make use of something known as React Native Modules ?
更多信息: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
推荐答案
好吧,我终于想通了,
我必须在 Objective-C 上创建函数并使用 RNBridge 将它们传递给 React Native,在Native Modules"中有更多解释
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,
使用的开发者令牌在我运行在 python 上的后端加密
The developer token used was encrypted on my back-end that is running on python
这篇关于连接到 Apple Music的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!