Skip to content

use native android call with app as parameter #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ code.

## Release Notes

### TBD
- Changes
- Remote Config(Android): Fix for getting Remote Config instance for a
specific app object.
([#991](https://github.com/firebase/quickstart-unity/issues/991).

### 7.3.0
- Changes
- General (iOS): Update dependencies.
Expand Down
9 changes: 7 additions & 2 deletions remote_config/src/android/remote_config_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ DEFINE_FIREBASE_VERSION_STRING(FirebaseRemoteConfig);
// clang-format off
#define REMOTE_CONFIG_METHODS(X) \
X(GetInstance, "getInstance", \
"()Lcom/google/firebase/remoteconfig/FirebaseRemoteConfig;", \
"(Lcom/google/firebase/FirebaseApp;)" \
"Lcom/google/firebase/remoteconfig/FirebaseRemoteConfig;", \
util::kMethodTypeStatic), \
X(EnsureInitialized, "ensureInitialized", \
"()Lcom/google/android/gms/tasks/Task;"), \
Expand Down Expand Up @@ -454,8 +455,12 @@ RemoteConfigInternal::RemoteConfigInternal(const firebase::App& app)

// Create the remote config class.
jclass config_class = config::GetClass();
jobject platform_app = app_.GetPlatformApp();
jobject config_instance_local = env->CallStaticObjectMethod(
config_class, config::GetMethodId(config::kGetInstance));
config_class,
config::GetMethodId(config::kGetInstance),
platform_app);
env->DeleteLocalRef(platform_app);
if (util::CheckAndClearJniExceptions(env)) config_instance_local = nullptr;
FIREBASE_ASSERT(config_instance_local);
internal_obj_ = env->NewGlobalRef(config_instance_local);
Expand Down