Enable Firebase Storage for React Native Media Uploads
Firebase Storage is used by apps that upload profile photos, post images, stories, chat attachments, product photos, listing photos, or videos.
Quick Answer
Enable Storage in Firebase Console, deploy the Storage rules included with your app package when available, make sure the app uses your Firebase config files, then test upload from a real app flow. Upload failures usually come from missing rules, missing Storage setup, missing native permissions, or backend media processing that has not been deployed.
1. Enable Storage
- Open Firebase Console.
- Select your Firebase project.
- Go to Storage.
- Create or enable the default bucket.
- Confirm the bucket belongs to the same Firebase project used by the app.
2. Deploy Storage Rules
If the app package includes a firebase/storage.rules file, review it and deploy
it from the Firebase folder:
firebase login
firebase use --add
firebase deploy --only storage
Rules must match your app's user model. Social apps, commerce apps, and listing apps often have different ownership rules.
3. Use Safe Development Rules
If your package does not include Storage rules yet, start with restrictive rules and expand by path.
Example authenticated user path:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /users/{userId}/{allPaths=**} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == userId;
}
match /{allPaths=**} {
allow read, write: if false;
}
}
}
Do not make the entire bucket public for production. Add path-level validation, file size limits, content-type checks, and ownership checks where appropriate.
4. Confirm Native Permissions
Media upload flows may require permissions for:
- camera;
- photo library;
- microphone for video;
- location metadata, if the app attaches location to media.
After changing native permission strings or packages, reinstall pods and rebuild:
cd ios
bundle exec pod install
cd ..
yarn ios
5. Test Uploads
Use the real app flow:
- sign in with a test user;
- select or capture media;
- upload it;
- confirm a file appears in Firebase Storage;
- confirm any related Firestore document stores the media URL/path;
- refresh the screen and confirm the uploaded media renders.
Blaze and Backend Processing
Some apps upload media directly to Storage. Others call Firebase Functions for processing, feed fan-out, thumbnail generation, moderation, or third-party APIs.
If uploads fail with Network request failed or an internal Functions error,
check:
- Firebase plan and billing readiness;
- deployed Functions;
- backend secrets;
- Storage rules;
- Firestore rules;
- the function region configured by the app.
Troubleshooting
| Problem | Fix |
|---|---|
| Upload fails with permission denied | Check Storage rules and authenticated user state. |
| Upload fails with network/internal error | Check Functions deploy, Firebase billing, backend secrets, and region. |
| Media uploads but does not appear in the app | Check Firestore document update and public/read rules for that path. |
| iOS cannot open camera or library | Check native permission strings and rebuild the app. |
| Android upload works but iOS fails | Recheck GoogleService-Info.plist, pods, and iOS permission setup. |