Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Multiple Firebase products together? / no app has been configured yet / Delayed Analytics Realtime #1162

Open
gokhancnr opened this issue Dec 12, 2024 · 2 comments

Comments

@gokhancnr
Copy link

What is your question?

Hi there,

I'm using;

  1. Analytics
  2. Crashlytics
  3. Cloud Messaging
  4. Remote Config

all together in my game:

FirebaseInitController:

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            DependencyStatus dependencyStatus = task.Result;

            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                FirebaseApp app = FirebaseApp.DefaultInstance;

                initialized = true;

                FirebaseAnalyticsController.Instance.InitializeFirebaseAnalytics();

                FirebaseCrashlyticsController.Instance.InitializeFirebaseCrashlytics();

                FirebaseRemoteConfigController.Instance.InitializeFirebaseRemoteConfig();

                FirebaseCloudMessagingController.Instance.InitializeFirebaseCloudMessaging();

                // Set a flag here to indicate whether Firebase is ready to use by your app.
            }

            else
            {
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
                // Firebase Unity SDK is not safe to use here.
            }
        });

FirebaseAnalyticsController.Instance.InitializeFirebaseAnalytics():

FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

FirebaseCrashlyticsController.Instance.InitializeFirebaseCrashlytics():

Crashlytics.ReportUncaughtExceptionsAsFatal = true;

FirebaseRemoteConfigController.Instance.InitializeFirebaseRemoteConfig():

       FirebaseRemoteConfig.DefaultInstance.SetDefaultsAsync(defaults).ContinueWithOnMainThread(task =>
        {
            //Debug.Log("Firebase RemoteConfig configured and ready!");

            ConfigSettings configSettings = new ConfigSettings
            {
                FetchTimeoutInMilliseconds = 0, //2000

                MinimumFetchIntervalInMilliseconds = 0
            };

            FirebaseRemoteConfig.DefaultInstance.SetConfigSettingsAsync(configSettings).ContinueWithOnMainThread(
                setting =>
                {
                    FetchDataAsync();
                });
        });

FirebaseCloudMessagingController.Instance.InitializeFirebaseCloudMessaging():

        FirebaseMessaging.MessageReceived += OnMessageReceived;

        FirebaseMessaging.TokenReceived += OnTokenReceived;

        //Debug.Log("Firebase Messaging Initialized");

        // This will display the prompt to request permission to receive
        // notifications if the prompt has not already been displayed before. (If
        // the user already responded to the prompt, thier decision is cached by
        // the OS and can be changed in the OS settings).
        FirebaseMessaging.RequestPermissionAsync().ContinueWithOnMainThread(task =>
        {
            LogTaskCompletion(task, "RequestPermissionAsync");
        });
  1. My first question is; is this methodology is ok to use when multiple Firebase products are together in a project?

  2. When I build on my iPhone logs are saying:

image

  1. And the last question is when I open my app I can not see my realtime Analytics data suddenly. How should I achieve to see my realtime analytics as soon as the application is opened?

Firebase Unity SDK Version

12.4.1

Unity editor version

6000.0.30f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

Analytics, Crashlytics, Messaging, Remote Config

Other Firebase Component(s) in use

No response

Additional SDKs you are using

No response

Targeted Platform(s)

Apple Platforms, Android

Unity editor platform

Mac, Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@gokhancnr
Copy link
Author

anybody?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants