firebase / firebase/firebase-unity-sdk
[FR]: Add multi-app support for Firebase Analytics
- Dominant language
- C#
- Stars
- 320
- Forks
- 60
- Avg merge
- 13h 32m
- Merged PRs (30d)
- 13
Description
### Description
Please add support in the Unity Firebase SDK for obtaining a FirebaseAnalytics instance tied to a specific FirebaseApp, similar to other modules like `FirebaseAuth.GetAuth(app)` and `FirebaseRemoteConfig.GetInstance(app)`.
### API Proposal
```cs
namespace Firebase.Analytics
{
public class FirebaseAnalytics
{
/// Returns the FirebaseAnalytics instance for the given FirebaseApp.
public static FirebaseAnalytics GetAnalytics(FirebaseApp app);
/// Logs an event to Firebase Analytics.
public void LogEvent(string name);
/// Static method to use the default app instance
public static void LogEvent(string name, Parameter[] parameters);
}
}
```
Usage:
```cs
FirebaseApp customApp = FirebaseApp.Create(new AppOptions() { /* ... */ }, "CustomApp");
FirebaseAnalytics analytics = FirebaseAnalytics.GetAnalytics(customApp);
analytics.LogEvent("custom_event");
```
### Firebase Product(s)
Analytics
### Targeted Platform(s)
All platforms
Contributor guide
Research direction
Start by comparing the proposed API with the existing FirebaseAuth.GetAuth(app) and FirebaseRemoteConfig.GetInstance(app) patterns. Then trace the Firebase Analytics entry points for the targeted platforms. Done means a custom FirebaseApp can obtain its own analytics instance while the proposed default-app static logging API continues to work on all platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- analytics, api, game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100