feat(remote-config): Added getJson and asJson method
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
- [x]
- My change includes tests;
- [x]
e2etests added or updated inpackages/\*\*/e2e - [x]
jesttests added or updated inpackages/\*\*/__tests__
- [x]
- [x] I have updated TypeScript types that are affected by my change.
- This is a breaking change;
- [ ] Yes
- [x] No
Test Plan
:fire:
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 |
🤔 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
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
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