Skip to content

Conversation

@amitojsingh
Copy link
Collaborator

@amitojsingh amitojsingh commented Aug 26, 2025

Add Firebase Remote Config + Audio Feature Flag

Summary

  • Integrated Firebase Remote Config with app-shipped defaults.
  • Added Audio feature flag (IS_AUDIO_FEATURE_ENABLED) to toggle remotely.
  • Externalized DB + Audio API endpoints and credentials to RC.
  • Upgraded @react-native-firebase packages → 23.1.2 and Firebase iOS pods → 12.1.0.
  • Replaced deprecated logScreenView with logEvent('screen_view', …).

Why

  • Safer config management (no hardcoded URLs).
  • Runtime control for features (can enable/disable Audio remotely).
  • Stay current with Firebase SDKs.

Notes

  • initRC() runs at app startup (with 12h fetch interval) so defaults are always present offline.
  • RC is client-readable → don’t store secrets; use for feature flags + endpoints only.
  • Settings now only shows Audio if flag is enabled.

Next steps

  • Test DB update + Audio API flows with RC values.
  • Roll out Audio flag gradually via RC targeting.
  • Add a simple dev screen later to dump/refresh RC values.

- Updated import paths for TrackPlayerUtils and AudioPlayer.
- Moved AudioPlayer to common index for better accessibility.
- Removed deprecated AudioPlayer and useTrackPlayer components along with their associated utilities.
- Cleaned up ReaderScreen to utilize the new structure.
- Added alias for @service in babel.config.js for improved module resolution.
- Disabled new architecture in android/gradle.properties for compatibility.
- Updated AndroidManifest.xml to export MusicService for proper functionality.
- Refactored ReaderScreen to utilize the new AudioPlayer component structure.
- Removed deprecated AudioPlayer component and styles from common components.
- Updated TrackPlayerUtils to streamline player setup and removed unused event listeners.
- Updated AudioPlayer component to include navigation and title props.
- Refactored audio settings in the Settings component to support auto-play and sync scroll options.
- Implemented new actions and reducers for managing audio settings and manifest.
- Improved API handling for fetching audio manifest and artists.
- Added styles for download controls and updated localization strings for audio settings.
- Removed deprecated useTrackPlayer hook to streamline audio management.
- Added useSelector to access isAudioAutoPlay state from Redux.
- Implemented useEffect to handle audio auto-play when currentPlaying is active.
- Enhanced play/pause functionality to accommodate auto-play behavior.
- Added useSelector to retrieve defaultAudio from Redux state.
- Enhanced track selection logic to prioritize default audio track if available.
- Maintained fallback to the first track in the manifest if no default track is found.
- Updated useAudioManifest hook to map API manifest data to new structure, including track_id and additional track properties.
- Modified audio.jsx to enhance logging for fetched artist data.
- Adjusted audioApi.js to streamline API requests for fetching manifests and artists, ensuring consistent endpoint usage.
- Removed unused queue retrieval in TrackPlayerUtils.js to clean up code.
- Introduced AudioTrackDialog and AudioControlBar components for better track selection and control.
- Added BlurView overlay for improved visual aesthetics.
- Updated state management to default showTrackModal to true.
- Refactored play/pause and track selection functionalities for enhanced user experience.
- Cleaned up unused code and styles for better maintainability.
- Added ESLint rules for unused styles and integrated react-native plugin for better linting.
- Updated Babel configuration to correct service path alias.
- Added new font asset (BalooPaaji2) to both iOS and Android platforms.
- Enhanced ReaderScreen with animated footer and improved audio player controls.
- Refactored AutoScrollComponent and AudioPlayer components for better performance and maintainability.
- Removed deprecated components and streamlined imports for cleaner code structure.
- Updated VSCode settings for improved development experience.
- Added @miblanchard/react-native-slider to package.json for improved audio control.
- Updated AudioPlayer component to utilize the new slider for track progress.
- Enhanced UI elements in AudioPlayer and related components to support night mode.
- Refactored styles for better responsiveness and visual consistency.
- Updated localization strings for improved user experience.
- Added initialization of Firebase Remote Config in app.js to enhance app configuration management.
- Updated Firebase dependencies in package.json to version 23.1.2 for improved functionality and performance.
- Adjusted Babel configuration to include new path alias for @config.
- Enhanced ReaderScreen to utilize audio settings from Remote Config.
- Updated Podfile.lock to reflect new Firebase versions and ensure compatibility.
@amitojsingh amitojsingh linked an issue Aug 26, 2025 that may be closed by this pull request
19 tasks
- Upgraded Firebase packages in package.json and Podfile.lock to version 12.1.0 for improved performance and features.
- Refactored AudioPlayer component to utilize default audio settings from Redux state, enhancing user experience.
- Introduced new hooks and state management for better audio track handling and settings.
- Improved UI elements in AudioPlayer and related components for better responsiveness and visual consistency.
- Updated action creators and reducers to support new default audio structure.
- Updated ActionComponent to dynamically set background and text colors based on night mode and selector state.
- Enhanced AudioControlBar to handle optional displayName gracefully.
- Modified AudioTrackDialog to allow optional title and header/footer props with default values.
- Cleaned up logging in useAudioManifest hook to streamline code.
…rganization

- Added import/order rule to ESLint for better import organization and readability.
- Refactored import statements across multiple components to maintain consistent ordering and structure.
- Updated project files to ensure compliance with new ESLint rules, enhancing overall code quality.
…y and functionality

- Updated font family in styles for better readability.
- Enhanced ActionComponent layout with a new wrapper for action button content.
- Adjusted AudioControlBar to improve slider appearance and timestamp display.
- Modified AudioTrackDialog to update button text and added new localization strings.
- Refactored icon components to standardize stroke properties and improve responsiveness.
- Integrated useRemote hook to fetch REMOTE_DB_URL for database updates across DatabaseUpdate and Download components.
- Updated checkForBaniDBUpdate function to accept REMOTE_DB_URL as a parameter for improved flexibility.
- Enhanced audio API requests in useAudioManifest and audio components to utilize remote configuration for authentication.
- Cleaned up constant.js by removing hardcoded URLs and credentials, promoting better configuration management.
@amitojsingh amitojsingh marked this pull request as ready for review September 5, 2025 21:19
… code

- Removed unused props from AudioControlBar and AudioTrackDialog for better clarity.
- Updated prop types in ChevronRight component to use default values, enhancing type safety.
…rformance

- Upgraded react-native-gesture-handler to version 2.28.0 for better gesture handling.
- Updated Android Gradle plugin to version 8.8.2 for improved build performance.
- Incremented versionCode in Android app build.gradle for the upcoming release.
- Modified MCP server configuration for updated local development settings.
- Refactored font assets in ReaderScreen to replace deprecated variable font with regular and semi-bold variants.
- Enhanced ReaderScreen components for better responsiveness and UI consistency.
- Cleaned up unused imports and improved code organization across various components.
…udio-setting-design

Update Firebase dependencies and enhance AudioPlayer functionality

await setDefaults(rc, defaultConfig);

await fetchAndActivate(rc);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be in a try-catch block to avoid app crash if any of these firebase operations fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


export const initRC = async () => {
// Dev: 1-min interval; Prod: 12h (43,200,000 ms)
await setConfigSettings(rc, { minimumFetchIntervalMillis: 43200000 });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fetch interval is hardcoded to 12 hours, but as per comment above, if it's dev environment it should be 1 min, right?

Should this condition be added here?

REMOTE_DB_URL: "https://banidb.blob.core.windows.net/database",
BASIC_AUTH_USERNAME: "admin",
BASIC_AUTH_PASSWORD: "",
REMOTE_AUDIO_API_URL: "http://10.0.0.45:3000/v1/",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://10.0.0.45:3000/v1
This looks like a local ip address. Is this correct?

// import { constant } from "@common";
import { dummyData, dummyArtists } from "./dummyData";

// Common API configuration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire codebase is commented out here. Remove if not needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

- Added error handling in remoteConfig.js to prevent app crashes when fetching remote values.
- Updated remoteConfig.js to ensure default values are returned when remote values are unavailable.
- Changed REMOTE_AUDIO_API_URL in remoteConfig.js to a production URL for improved API access.
- Refactored audioApi.js to streamline API request logic and enhance error handling.
- Cleaned up commented-out code in audioApi.js for better readability.
@amitojsingh amitojsingh linked an issue Oct 24, 2025 that may be closed by this pull request
4 tasks
Base automatically changed from add-audio-player to dev October 28, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Firebase Remote config for Audio Toggle Add audio to sunder gutka

3 participants