Skip to content

Feature/firebase sdk extensions#38

Open
egiray wants to merge 9 commits into
godot-x:mainfrom
egiray:feature/firebase-sdk-extensions
Open

Feature/firebase sdk extensions#38
egiray wants to merge 9 commits into
godot-x:mainfrom
egiray:feature/firebase-sdk-extensions

Conversation

@egiray
Copy link
Copy Markdown
Contributor

@egiray egiray commented Apr 28, 2026

🚀 Firebase SDK Extensions & Architectural Refactor

I needed more Firebase features for my game development, so I implemented a major update to this plugin. This PR introduces multiple modules and functions simultaneously to bring the SDK to a production-ready state.

Important

This PR introduces breaking changes regarding API signatures and Test Harness logic. Please review the Breaking Changes section carefully.


🛠️ Problem & Solution

The original test screen and architecture were limited for complex game requirements. I have:

  • Moved to a Tabbed Dashboard system for better visibility.
  • Implemented ActionRegistry.gd to handle 38+ functions dynamically.
  • Added Real-time feedback (Yellow/Green/Red) to verify signals on physical devices.

📝 Solving Open Issues


✨ Key Enhancements

  • Massive Expansion: Increased testable functions from 11 to 38 across all modules.
  • Remote Config: New module with real-time update support and JSON/Dictionary mapping.
  • Enhanced Analytics: Added 10+ predefined game events (level_start, earn_currency, etc.).
  • Stability: Fixed critical data type handling (Booleans/Strings) between Godot and Native JNI/ObjC++ bridges.
  • iOS Excellence: Full APNs token support and improved notification payload handling.

⚠️ Breaking Changes

Caution

If you are migrating from the previous version, please update your code according to these changes:

1. Crashlytics: API Unification

  • Removed: Typed methods set_custom_value_string/int/bool/float.
  • Added: A single, unified set_custom_value(key, value) method.
  • Reason: Simplifies the cross-platform bridge and reduces boilerplate.

2. Messaging: Signal Signature Update

  • Changed: messaging_message_received(title, body)messaging_message_received(title, body, data: Dictionary).
  • Reason: Essential for deep-linking and handling custom notification payloads.

3. Test Harness: New Architecture

  • Legacy button handlers in Main.gd have been removed in favor of the dynamic ActionRegistry.gd system.

📖 API Reference (Full List)

Click to expand ⚙️ Firebase Remote Config
  • initialize(): Checks if module is ready. Emits remote_config_initialized.
  • fetch_and_activate(): Fetches and activates latest config.
  • get_string(key, default): Returns string value.
  • get_int(key, default): Returns integer value.
  • get_float(key, default): Returns float value.
  • get_bool(key, default): Returns boolean as int (1/0) for JNI stability.
  • get_dictionary(key): Parses JSON string into Godot Dictionary.
  • set_defaults(defaults): Sets local default values.
  • set_minimum_fetch_interval(seconds): Sets fetch throttle.
  • setup_realtime_updates(): Enables real-time console updates.
Click to expand 📊 Firebase Analytics
  • initialize(): Initializes the module.
  • log_event(name, params): Logs custom events.
  • log_screen_view(name, class): Tracks screens.
  • set_user_id(id): Sets unique user identifier.
  • log_level_start(name) / log_level_end(name, success): Game flow tracking.
  • log_earn_currency / log_spend_currency: Virtual economy tracking.
  • log_tutorial_begin / log_tutorial_complete: User onboarding tracking.
  • set_consent(consent_data): GDPR/DMA compliance.
Click to expand 💬 Firebase Messaging (FCM)
  • initialize(): Initializes messaging.
  • request_permission(): OS notification prompt.
  • get_token(): Requests FCM token.
  • get_apns_token(): Requests Apple APNs token (iOS only).
  • get_last_notification(): Returns last received payload as Dictionary.
Click to expand ⚠️ Firebase Crashlytics
  • initialize(): Initializes crash reporting.
  • crash(): Forces a test crash.
  • log_message(message): Adds breadcrumb to crash reports.
  • log_non_fatal(message): Records non-fatal exceptions.
  • set_custom_value(key, value): Adds metadata to reports.

I have verified these changes on physical Android and iOS devices. Looking forward to your feedback!

egiray added 9 commits April 26, 2026 00:27
…ndency

- Extend Android messaging plugin with topic subscription, token access, and notification data payload
- Extend iOS messaging delegate with APN token handling and data payload forwarding
- Relocate GoogleDataTransport.xcframework to Firebase Core to avoid duplicate symbol errors
- Update AnalyticsView and MessagingView scenes with Phase 2 test harness UI
- Update Makefile to manage GoogleDataTransport in Core plugin directory only
…date iOS notification handling, and integrate Godot MCP tools.
…hlytics plugin for improved key-value handling
@paulocoutinhox
Copy link
Copy Markdown
Contributor

paulocoutinhox commented Apr 28, 2026

Are using AI to make things? The same patch problem have here.

Also, the code is very complex to people copy/paste. You made in a way that people adopt this pattern to can use.

You can use IA, but need keep simplicity to be easy copy/paste in the user real projects.

@egiray
Copy link
Copy Markdown
Contributor Author

egiray commented Apr 28, 2026

I know there is still some cleanup needed and some remnants in the code.

However, I don't understand what you mean by the code being hard to copy/paste. What exactly are you referring to? The features are implemented as simple singletons, same as before.

@egiray
Copy link
Copy Markdown
Contributor Author

egiray commented May 5, 2026

Hi @paulocoutinhox

If you are referring to the ActionRegistry, it's strictly for the test harness. I haven't updated the README yet since we haven't agreed on the direction, but the core features can still be used via simple copy-paste as before.

I'm aware this is a large PR that changes a lot. If you don't want this direction for the project, just say so clearly and we can close it here. Or if you want something to change we can talk about it as well.

Sign up for free to 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