Skip to content

Commit dfa6a8b

Browse files
authored
Merge pull request #315 from firebase/g3merge4
Update the Unity Remote Config API
2 parents 88fa3ba + 179d7eb commit dfa6a8b

File tree

3 files changed

+4
-49
lines changed

3 files changed

+4
-49
lines changed

remote_config/src/common.cc

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,57 +23,16 @@
2323
// Register the module initializer.
2424
FIREBASE_APP_REGISTER_CALLBACKS(remote_config,
2525
{
26-
if (app == ::firebase::App::GetInstance()) {
27-
return firebase::remote_config::Initialize(
28-
*app);
29-
}
26+
// Nothing to do.
3027
return kInitResultSuccess;
3128
},
3229
{
33-
if (app == ::firebase::App::GetInstance()) {
34-
firebase::remote_config::Terminate();
35-
}
30+
// Nothing to do.
3631
});
3732

3833
namespace firebase {
3934
namespace remote_config {
4035

41-
namespace internal {
42-
43-
const char kRemoteConfigModuleName[] = "remote_config";
44-
45-
// Registers a cleanup task for this module if auto-initialization is disabled.
46-
void RegisterTerminateOnDefaultAppDestroy() {
47-
if (!AppCallback::GetEnabledByName(kRemoteConfigModuleName)) {
48-
CleanupNotifier* cleanup_notifier =
49-
CleanupNotifier::FindByOwner(App::GetInstance());
50-
assert(cleanup_notifier);
51-
cleanup_notifier->RegisterObject(
52-
const_cast<char*>(kRemoteConfigModuleName), [](void*) {
53-
LogError(
54-
"remote_config::Terminate() should be called before default app "
55-
"is destroyed.");
56-
if (firebase::remote_config::internal::IsInitialized()) {
57-
firebase::remote_config::Terminate();
58-
}
59-
});
60-
}
61-
}
62-
63-
// Remove the cleanup task for this module if auto-initialization is disabled.
64-
void UnregisterTerminateOnDefaultAppDestroy() {
65-
if (!AppCallback::GetEnabledByName(kRemoteConfigModuleName) &&
66-
firebase::remote_config::internal::IsInitialized()) {
67-
CleanupNotifier* cleanup_notifier =
68-
CleanupNotifier::FindByOwner(App::GetInstance());
69-
assert(cleanup_notifier);
70-
cleanup_notifier->UnregisterObject(
71-
const_cast<char*>(kRemoteConfigModuleName));
72-
}
73-
}
74-
75-
} // namespace internal
76-
7736
FutureData* FutureData::s_future_data_;
7837

7938
// Create FutureData singleton.

remote_config/src/common.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ namespace internal {
6969
// Implemented in each platform module.
7070
bool IsInitialized();
7171

72-
// Registers a cleanup task for this module if auto-initialization is disabled.
73-
void RegisterTerminateOnDefaultAppDestroy();
74-
75-
// Remove the cleanup task for this module if auto-initialization is disabled.
76-
void UnregisterTerminateOnDefaultAppDestroy();
77-
7872
// Waits until the given future is complete and asserts that it completed with
7973
// the given error (no error by default). Returns the future's result.
8074
template <typename T>

remote_config/src/include/firebase/remote_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ FIREBASE_APP_REGISTER_CALLBACKS_REFERENCE(remote_config)
3434
/// @brief Namespace that encompasses all Firebase APIs.
3535
namespace firebase {
3636

37+
#ifndef SWIG
3738
/// @brief Firebase Remote Config API.
3839
///
3940
/// Firebase Remote Config is a cloud service that lets you change the
4041
/// appearance and behavior of your app without requiring users to download an
4142
/// app update.
43+
#endif // SWIG
4244
namespace remote_config {
4345

4446
/// @brief Describes the most recent fetch request status.

0 commit comments

Comments
 (0)