Closed adilanchian closed 4 years ago
NOTE:
Need to add an expiration time on the Apple Music User Token
New design for Apple Auth Flow
At the beginning of trying to setup our new views, the react-native-navigation library was giving us pains again.... It's time to switch to React-Navigation. I think this needs to happen now as the app is still relatively small. Going to do that now before continuing on here.
HERE IS THE NEW FLOW:
When authenticating with a service provider associated with Firebase, a UID is created for us automatically and we can’t change it. That leaves us with issues in our Firebase Rules to go ahead and access certain documents. Since the custom authenticated users have the proper ID’s.
Create a new collection that maps firebase auth users to their documents. IE: Firebase User UID: 1234567 —> Firebase User Doc {id: apple:999999}
That would mean all our Firebase rules will probably have to change and the way we fetch documents will probably also have to change.
Apple Music Prompt Flows:
When creating playlist, prompt user to auth with Apple Music
After authing with Apple Music we will need some flag to not prompt the auth again
(Testing this out in dev first) So some notes:
All the issues we were having last week with accessing the new functions in prod is like 75% fixed now. I had to move two functions from the client to Firebase Functions as there was no authentication at the point of calling these queries so gotta do em in the cloud! Just have to deal with a few more firebase rules (all the actions for playlists and such).
Then we will need to deploy two more functions to the cloud, update the firebase rules and then we can move on hahaha
We are finally done.... WOW.
We currently have Spotify authentication setup and now need Apple. This is required by Apple currently. We also would like to user Apple Music for creating playlists and things of that nature. The current issue with this is there is no "straight forward" way to do this in React Native. We will need to implement some NativeModules to get this thing work. Currently this task should include: