Skip to content

How to get json from remote config #130

@crazyhappygame

Description

@crazyhappygame

Please fill in the following fields:

Firebase C++ SDK version: Latest
Firebase plugins in use (Auth, Database, etc.): RemoteConfig
Additional SDKs you are using (Facebook, AdMob, etc.): None
Platform you are using the SDK on (Mac, Windows, or Linux): Android
Platform you are targeting (iOS, Android, and/or desktop): Android

Please describe the issue here:

Please provide example how to read arbitrary JSON from remote config.
In https://console.firebase.google.com I set
level_to_star_count = {"level_1":9,"level_2":8}

How can I read those data from C++
I would expect interface similar to GetLong, GetBoolean

std::map<firebase::Variant, firebase::Variant> GetMap(const char* key)

or some generic:

firebase::Variant GetVariant(const char* key);
... and
const firebase::Variant variant = GetVariant("level_to_star_count");
if(variant.is_map())
{
     const std::map<firebase::Variant, firebase::Variant>& map = variant.map()
}

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts (this GitHub project)?

What's the issue repro rate? 100%

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions