iosobjective-cswiftreact-nativeapple-musickit

Connecting to Apple Music


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


Solution

  • 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