Manage Songs in the TikTok-Style React Native App
The composer can display a song catalog so users can attach audio to videos or posts. The catalog is usually stored in Firestore and points to media hosted in Firebase Storage or another CDN.
Quick Answer
Create a composer_songs collection in Firestore, add one document per song,
include title, artist, cover URL, duration, and stream URL fields, then open the
song picker in the app and confirm songs load and play.
Collection
Common collection name:
composer_songs
Confirm the collection name in your package:
rg "composer_songs|SongPicker|songs" src
Document Fields
Use one document per song:
{
artist: 'Artist Name',
title: 'Song Title',
coverURL: 'https://example.com/cover.jpg',
duration: '00:28',
streamURL: 'https://example.com/song.mp3'
}
Recommended field rules:
| Field | Type | Notes |
|---|---|---|
artist | string | Artist or creator name. |
title | string | Song title shown in the picker. |
coverURL | string | HTTPS image URL for the cover artwork. |
duration | string | Display duration, such as 00:28. |
streamURL | string | HTTPS audio URL. |
Use valid HTTPS URLs. If you upload audio or cover files to Firebase Storage, make sure Storage rules allow the app to read those files.
Add Songs
- Open Firebase Console.
- Go to Firestore Database.
- Create or open the
composer_songscollection. - Add a document for each song.
- Add the required fields as strings.
- Save and reload the song picker in the app.
Where the App Reads Songs
File names vary by package version. Search instead of relying on a fixed line number:
rg "SongPicker|composer_songs|streamURL|coverURL" src
The song picker screen usually fetches the Firestore collection and passes the selected song into the composer flow.
Verification Checklist
composer_songsexists in Firestore.- Each song has all required fields.
- Cover URL opens in a browser.
- Stream URL opens in a browser or supported audio player.
- Song picker displays songs.
- Selecting a song returns to the composer.
- Composer stores the selected song metadata on the post.
Troubleshooting
| Problem | Fix |
|---|---|
| Song picker is empty | Check collection name, Firestore rules, and required fields. |
| Cover image does not load | Check coverURL, Storage rules, and HTTPS access. |
| Song does not play | Check streamURL, file format, CORS/CDN access, and device audio mode. |
| Selected song is not saved | Check composer post payload and Firestore write rules. |