33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using UnityEngine;
|
|
|
|
public class StartCrashlytics : MonoBehaviour
|
|
{
|
|
#if OVR_SAMPLES_ENABLE_FIREBASE
|
|
Firebase.FirebaseApp app;
|
|
void Start()
|
|
{
|
|
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
|
|
var dependencyStatus = task.Result;
|
|
if (dependencyStatus == Firebase.DependencyStatus.Available)
|
|
{
|
|
// Create and hold a reference to your FirebaseApp,
|
|
// where app is a Firebase.FirebaseApp property of your application class.
|
|
app = Firebase.FirebaseApp.DefaultInstance;
|
|
|
|
// Set a flag here to indicate whether Firebase is ready to use by your app.
|
|
Firebase.Crashlytics.Crashlytics.IsCrashlyticsCollectionEnabled = true;
|
|
}
|
|
else
|
|
{
|
|
UnityEngine.Debug.LogError(System.String.Format(
|
|
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
|
|
// Firebase Unity SDK is not safe to use here.
|
|
}
|
|
});
|
|
}
|
|
#endif
|
|
}
|