Skip to content

Commit cb775b6

Browse files
authored
Desktop Heartbeats - Log Heartbeat after User Agents are registered (#467)
Note - this depends on PR 1089 from the firebase-cpp-sdk for the definition of App->LogHeartbeat
1 parent 6462c92 commit cb775b6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/src/swig/app.i

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "app/src/include/firebase/app.h"
4343
#include "app/src/callback.h"
4444
#include "app/src/include/firebase/internal/mutex.h"
45+
#include "app/src/include/firebase/internal/platform.h"
4546
#include "app/src/app_common.h"
4647
#include "app/src/log.h"
4748
#include "app/src/util.h"
@@ -906,6 +907,8 @@ static firebase::AppOptions* AppOptionsLoadFromJsonConfig(const char* config) {
906907
// fire-(unity|mono)/<github-action-built|custom_built>
907908
RegisterLibraryInternal(
908909
libraryPrefix + "-buildsrc", Firebase.VersionInfo.BuildSource);
910+
// Log a heartbeat after all Unity user agents have been registered.
911+
LogHeartbeatInternal(newProxy);
909912
}
910913
// Cache the name so that it can be accessed after the app is disposed.
911914
newProxy.name = newProxy.NameInternal;
@@ -1313,6 +1316,15 @@ namespace callback {
13131316
firebase::App::RegisterLibrary(library, version);
13141317
}
13151318

1319+
%csmethodmodifiers LogHeartbeatInternal(App* app) "internal";
1320+
static void LogHeartbeatInternal(App* app) {
1321+
#if FIREBASE_PLATFORM_DESKTOP
1322+
// Only need to call LogHeartbeat on desktop, since native mobile SDKs
1323+
// Will handle heartbeat logging internally.
1324+
app->LogHeartbeat();
1325+
#endif // FIREBASE_PLATFORM_DESKTOP
1326+
}
1327+
13161328
%csmethodmodifiers AppSetDefaultConfigPath(const char* path) "internal";
13171329
static void AppSetDefaultConfigPath(const char* path) {
13181330
firebase::App::SetDefaultConfigPath(path);

0 commit comments

Comments
 (0)