Extensions for original Firebase for Unity WebGL package.
- callback-based API turned to be async/await API
- Firebase for Unity WebGL package: com.am1goo.firebase.webgl
- UniTask package: com.cysharp.unitask
The latest version can be installed via package manager using following git URL:
https://github.com/am1goo/FirebaseWebGL-Unity-UniTask.git#0.9.0
private FirebaseWebGL.FirebaseApp app;
void Awake()
{
app = FirebaseWebGL.FirebaseApp.DefaultInstance();
}async UniTask InitializeAsync(CancellationToken cancellationToken)
{
if (app.Analytics != null)
{
try
{
await app.Analytics.InitializeAsync(cancellationToken);
Debug.Log($"Initialized: {isInitialized}");
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
}.. .
... app.Analytics.LogEvent("my event");
.. .- Unity 2020.3.x
Contribution in any form is very welcome. Bugs, feature requests or feedback can be reported in form of Issues.