-
Notifications
You must be signed in to change notification settings - Fork 433
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
[Bug] RemoteConfig ignores FirebaseApp on Android #991
Comments
Hi @Girildo, It's rather odd that the behavior in the build isn't the same with the editor's behavior. Could you share a minimal, reproducible example of your project so that I can identify what's causing the issue and hopefully provide a solution? Thanks. |
So, I created a fresh Unity Project and two fresh Firebase Projects.
with the files I have a single script, // Repro.cs
using Firebase;
using Firebase.Extensions;
using System;
using System.Threading.Tasks;
using UnityEngine;
public class Repro : MonoBehaviour
{
void Start()
{
FirebaseApp.LogLevel = LogLevel.Verbose;
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
Application.SetStackTraceLogType(LogType.Warning, StackTraceLogType.None);
this.TestApp("google-services-1")
.ContinueWithOnMainThread(prec => this.TestApp("google-services-2"));
}
private Task TestApp(string infoPath)
{
var info = Resources.Load<TextAsset>(infoPath).text;
var options = AppOptions.LoadFromJsonConfig(info);
var app = FirebaseApp.Create(options, infoPath);
return FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(dependencies =>
{
if (dependencies.Result == DependencyStatus.Available)
{
var remoteConfig = Firebase.RemoteConfig.FirebaseRemoteConfig.GetInstance(app);
remoteConfig.FetchAsync(TimeSpan.Zero)
.ContinueWithOnMainThread(fetch =>
{
remoteConfig.ActivateAsync()
.ContinueWithOnMainThread(activation =>
{
var value = remoteConfig.GetValue("parameter").StringValue;
Debug.Log($"Firebase app name: {remoteConfig.App.Name}. Parameter variable: {value}");
});
});
}
});
}
} Editor log:
Android build log:
As a side remark: the file |
I have uploaded the project here |
Hi @Girildo, I'm having issues on my end trying to build the app from your project. While I try to fix this issue, could you try sharing your project in the form of a .unitypackage file? |
Sure, here it is https://github.com/Girildo/RemoteConfigRepro/blob/master/Repro.unitypackage |
Hi @Girildo, I've successfully built the project you provided, and I was able to reproduce the behavior you're facing. With that, I've internally filed a bug report for this (b/183105235), and I'll let you know once I have an update. |
Hi @Girildo, |
Sorry, this change missed the 7.3.0 release but we will make sure it goes out in the next one. |
Please fill in the following fields:
Please describe the issue here:
I have two Firebase projects, one for production and one as a test environment. I can swap between the two with no issues with every other Firebase component by doing, on startup,
I initialize RemoteConfig by means of
and fetch data by doing
In the editor, everything behaves consistently: the config value are fetched from the correct Firebase project.
In the Android build, however, regardless of the environment, the app fetches data from the production (and default) environment.
It is worth adding that the package name of both the test and the production environment are identical.
The following test code:
produces the following "output"
The text was updated successfully, but these errors were encountered: