react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

feat(remote-config): Added getJson and asJson method

Open Rohit3523 opened this issue 1 year ago • 4 comments

Description

This pull request introduces an getJson('key') and getValue('key').asJson() method to the Remote Config module of @react-native-firebase/remote-config. Currently, Firebase allows storing data as JSON, including objects and arrays. However, this library does not provide a direct way to retrieve these values in their parsed JSON form. Users have to manually fetch the data as strings and then parse it themselves.

With the new method, users can now directly retrieve JSON-encoded values as JSON objects and arrays. This addition aligns the library with Firebase’s support for various data types and simplifies handling complex data structures. Instead of manually parsing string values, users can now obtain object and array data with a single method call, reducing complexity and improving ease of use.

Related issues

No related issues at the moment

Release Summary

Added getJson('key') and getValue('key').asJson() method to Remote Config to retrieve JSON-encoded values as JSON objects and arrays, aligning with Firebase's supported data types and simplifying data handling

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • [x] Yes
  • My change supports the following platforms;
    • [x] Android
    • [x] iOS
  • My change includes tests;
    • [x] e2e tests added or updated in packages/\*\*/e2e
    • [x] jest tests added or updated in packages/\*\*/__tests__
  • [x] I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • [ ] Yes
    • [x] No

Test Plan

:fire:

Rohit3523 avatar Sep 15 '24 20:09 Rohit3523

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2024 8:44pm

vercel[bot] avatar Sep 15 '24 20:09 vercel[bot]

🤔 hmm - this isn't an API on the public firebase-js-sdk RemoteConfig unless I'm reading it incorrectly https://github.com/firebase/firebase-js-sdk/blob/629919ea760e35b7d880a099edf7f42b5bcbae4b/packages/remote-config-types/index.d.ts#L18

mikehardy avatar Sep 15 '24 21:09 mikehardy

Not sure why they don't have a method to get data as json but they allow us to set data as json in firebase console

Rohit3523 avatar Sep 15 '24 21:09 Rohit3523

Hello 👋, this PR has been opened for more than 2 months with no activity on it.

If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!

You have 15 days until this gets closed automatically

github-actions[bot] avatar Oct 14 '24 21:10 github-actions[bot]