Skip to content

Add remote configs listener to the C API + Linux build compatibility fixes - #48

Open
Gogoshika-ga wants to merge 10 commits into
mainfrom
feature/c-api-remote-configs-listener
Open

Add remote configs listener to the C API + Linux build compatibility fixes#48
Gogoshika-ga wants to merge 10 commits into
mainfrom
feature/c-api-remote-configs-listener

Conversation

@Gogoshika-ga

Copy link
Copy Markdown
Member

Adds a remote configs callback to the C API so managed runtimes (Unity P/Invoke) can be notified when remote configs arrive, instead of polling isRemoteConfigsReady(). Also merges fix_linux_compatibility.

Added

  • gameAnalytics_configureRemoteConfigsListener() with a GARemoteConfigsListener callback. Single listener: re-registering replaces it, NULL unregisters. Register before initialize() to not miss the first update.
  • The callback fires on the SDK's internal thread; the string is only valid for the duration of the call.
  • exported_symbols_apple.txt — restricts shared-library exports to _gameAnalytics_* on Apple platforms.

Fixed

  • Linux detection in CMake: if(LINUX)if(UNIX AND NOT APPLE) (LINUX requires CMake 3.25+ and was silently false on older versions).
  • Clang detection: CMAKE_CXX_COMPILER MATCHES "clang"CMAKE_CXX_COMPILER_ID.
  • getOSVersion() on Linux: signed/unsigned comparison warning and UB from passing a plain char to isdigit.
  • Unparseable cached SDK config is now discarded with a warning rather than logged as an error and left in place.
  • setup.py picks the windows-static-md / windows-static vcpkg triplet to match CMAKE_MSVC_RUNTIME_LIBRARY.

Testing

Not built on Linux — the Linux-only changes are unverified beyond review.

🤖 Generated with Claude Code

Gogoshika-gaand others added 10 commits June 10, 2026 11:27
Replace the CMake>=3.25-only LINUX variable with UNIX AND NOT APPLE,
and the non-existent CLANG variable with a CMAKE_CXX_COMPILER_ID match
so the clang libc++ flags are actually applied.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Statically link curl/openssl/zlib into the DLL so the Unity plugin is a
single self-contained GameAnalytics.dll. The -static-md variant keeps the
dynamic CRT (/MD) to match shared builds.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Discard an unparseable cached config (e.g. legacy C# base64 format)
instead of logging it as an error; a fresh config is fetched on init
and rewritten as JSON.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…igs-listener
# Conflicts:
#	source/gameanalytics/GAState.cpp
#	source/gameanalytics/Platform/GALinux.cpp
@github-actions

Copy link
Copy Markdown

LCOV of commit 743eabc during Test Coverage #142

Summary coverage rate:
lines......: 40.6% (1155 of 2844 lines)
functions..: 52.5% (210 of 400 functions)
branches...: no data found
Files changed coverage rate: n/a

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Gogoshika-ga@dorin-ga