The Firebase Unity SDK provides Unity packages for the following Firebase features on iOS, tvOS and Android.
Note: Firebase Dynamic Links is not supported on tvOS.
Feature | Unity Package |
---|---|
Firebase Analytics | FirebaseAnalytics.unitypackage |
Firebase Authentication | FirebaseAuth.unitypackage |
Firebase Crashlytics | FirebaseCrashlytics.unitypackage |
Firebase Dynamic Links | FirebaseDynamicLinks.unitypackage |
Cloud Firestore | FirebaseFirestore.unitypackage |
Firebase Functions | FirebaseFunctions.unitypackage |
Firebase Installations | FirebaseInstallations.unitypackage |
Firebase Messaging | FirebaseMessaging.unitypackage |
Firebase Realtime Database | FirebaseDatabase.unitypackage |
Firebase Remote Config | FirebaseRemoteConfig.unitypackage |
Firebase Storage | FirebaseStorage.unitypackage |
The SDK provides .NET 4.x compatible packages
The Firebase Unity SDK includes desktop workflow support for the following Firebase features, enabling their use in the Unity editor and in standalone desktop builds on Windows, OS X, and Linux:
Feature | Unity Package |
---|---|
Firebase Authentication | FirebaseAuth.unitypackage |
Firebase Realtime Database* | FirebaseDatabase.unitypackage |
Cloud Firestore | FirebaseFirestore.unitypackage |
Firebase Functions | FirebaseFunctions.unitypackage |
Firebase Remote Config | FirebaseRemoteConfig.unitypackage |
Firebase Storage | FirebaseStorage.unitypackage |
(* See Known Issues in the Release Notes below.)
This is a Beta feature, and is intended for workflow use only during the development of your app, not for publicly shipping code.
Stub (non-functional) implementations of the remaining libraries are provided for convenience when building for Windows, OS X, and Linux, so that you don't need to conditionally compile code when also targeting the desktop.
The AdMob Unity plugin is distributed separately and is available from the AdMob Get Started guide.
You need to follow the SDK setup instructions. Each Firebase package requires configuration in the Firebase Console. If you fail to configure your project your app's initialization will fail.
SetConsent()
and GetSessionIdAsync()
APIs.ReportUncaughtExceptionsAsFatal
property and LogExceptionAsFatal
API.ConfigSettings.MinimumFetchIntervalInMilliseconds
,
which should be used instead of MinimumFetchInternalInMilliseconds
. The
old one is considered deprecated, and will be removed with the next major release.PhoneAuthProvider.MaxTimeoutMs
. The actual
range is determined by the underlying SDK, ex. PhoneAuthOptions.Builder in Android SDK.TransactionOptions
to control how many times a
transaction will retry commits before failing
(#318).RegistrationIntentService
.
(#973).GetHttpsCallableFromURL
, to create callables
with URLs other than cloudfunctions.net.+load
method.281ba7
. With this change, disabling tagged pointers is no longer
required, so the following can be removed from your manifest's
application tag: android:allowNativeHeapPointerTagging=false
.SetCustomKey
functions,
significantly reducing the number objects created and disk writes when
keys are updated frequently.+load
method.
(#706)
(#783)Equals()
and GetHashCode()
methods
of DocumentSnapshot
would sometimes be inconsistent
(#8647).LoadBundleAsync()
.DocumentReference.Set()
was
invoked with an invalid documentData
value (e.g. an int).FirebaseFirestore
.FirebaseFirestore
instance. This is a backwards-incompatible change and
requires updates to code that sets FirebaseFirestore.Settings
.Query.WhereNotIn()
from List
to
IEnumerable
, to be consistent with Query.WhereIn()
.Equals
and GetHashCode
methods from Query
,
QuerySnapshot
, and DocumentSnapshot
classes. These methods were
unimplemented, and we plan to add proper support for them in a future
release.IDisposable
for ListenerRegistration
(#746).null
and empty string argument checks to all
public methods, which now throw exceptions instead of crashing
(#1053).FirebaseFirestore.LoadBundleAsync()
and
FirebaseFirestore.GetNamedQueryAsync()
. Bundles contain pre-packaged
data produced with the Firestore Server SDKs and can be used to populate
Firestore's cache without reading documents from the backend.FirebaseRemoteConfigDeprecated
and the property
ConfigSettings.IsDeveloperMode
have been removed.ArgumentException
, InvalidOperationException
and
FirestoreException
with ErrorCode
set to Internal
). These exceptions
are not meant to be caught -- rather, they are to help with debugging and
to avoid crashing the Unity editor instance.
Important: on iOS, you would need to change two settings on the exported
XCode project for this feature to work properly. Open Build Settings
and
make sure that Enable C++ Exceptions
and Enable C++ Runtime Types
settings are set to Yes
for all of the following: the Unity-iPhone
scheme, the UnityFramework
scheme (for Unity versions 2019.3 and above)
and the Unity-iPhone
project. If you're doing incremental iOS builds
(i.e., if you use Append
instead of Replace
when doing the build),
these settings will persist between rebuilds, so you would only have to do
this once per project.RunTransactionAsync()
to roll back the transaction if
the task returned from the given callback faults
(#1042).ValueListener
s or
ChildListener
s rapidly.enqueueWork
instead of startService
.FirebaseRemoteConfig
to be an instanced class,
with new APIs to better manage fetching config data. The old static
methods are now deprecated, and can be accessed in the new class
FirebaseRemoteConfigDeprecated
.ConfigSettings.IsDeveloperMode
is now obsolete and does
nothing. ConfigSettings.MinimumFetchInternalInMilliseconds
should be
adjusted instead.Unity-iPhone
target in
Unity 2019.3+.UpdateAsync()
with
FieldValue.Delete
(#882).DocumentSnapshot.ToDictionary()
on non-existent
documents when running on Android
(#887).FetchProvidersForEmailAsync
.enqueueWork
instead of startService
.
Fixes bug where we lost messages with data payloads received when app
is in background.
(#877ConfigValue.DoubleValue
and ConfigValue.LongValue
to be locale independent.FirebaseApp.CheckDependencies()
API.DownloadUrl
and DownloadUrls
properties in
StorageMetadata
.DynamicLinkComponents.DynamicLinkDomain
. Please use DynamicLinkComponents.DomainUriPrefix
instead.WhereNotEqualTo
and WhereNotIn
queries.FirebaseFirestoreSettings.CacheSizeBytes
.FirebaseApp.SetEditorAuthUserId()
and
FirebaseApp.GetEditorAuthUserId()
in order to improve performance.androidlib
extension.Assets/Plugins/Android/Firebase
which is causing build error in
Unity 2020.Error.None
as a synonym for Error.Ok
, which is more
consistent with other Firebase Unity APIs.Plugins/Android/FirebaseCrashlytics.androidlib
.CollectionReference.AddAsync()
to propagate errors.FirestoreException
.Error
enum to FirestoreError
.Send
function.ListenerRegistration.ListenerTask
tasks fault.ListenerRegistration.ListenerTask
property which
facilitates discovering an error that causes the listener stream to stop.GoogleServicesInfo.plist
and
google-services.json
files.[assembly: Preserve]
attribute to
Firebase.Crashlytics namespace, to prevent stripping of Crashlytics code
by the UnityLinker.WaitForPendingWritesAsync
method which allows users to
wait on a task that completes when all pending writes are acknowledged
by the firestore backend.TerminateAsync
method which terminates the instance,
releasing any held resources.ClearPersistenceAsync
method which clears the
persistent cache, allowing unit/integration tests to be more isolated.Query.LimitToLast(int n)
, which returns the last
n
documents as the result.DocumentReference.ListenerDelegate
and
Query.ListenerDelegate
delegates. These were intended to be
internal-only types.Firestore.LoggingEnabled
is replaced by Firestore.LogLevel
for consistency with other Firebase Unity APIs. The getter for this
property has been removed.Query.WhereArrayContains()
query operator to find
documents where an array field contains a specific element.FieldValue.ArrayUnion()
and FieldValue.ArrayRemove()
to atomically add and remove elements from an array field in a document.Query.WhereIn()
and Query.WhereArrayContainsAny()
query operators. Query.WhereIn()
finds documents where a specified
field’s value is IN a specified array. Query.WhereArrayContainsAny()
finds documents where a specified field is an array and contains ANY
element of a specified array.FirebaseAnalytics.GetAnalyticsInstanceId()
after calling
FirebaseAnalytics.ResetAnalyticsData()
.Task.ContinueWithOnMainThread()
, which
forces the continuation of asynchronous operations to occur in the Unity
main thread rather than in a background thread.GetBytesAsync
.firebase-messaging
Android library without the Firebase Unity
Messaging component.CheckAndFixDependenciesAsync()
is still in progress.FirebaseUser.UpdatePhoneNumberCredentialAsync()
.SubscribeAsync
and UnsubscribeAsync
, which return
Tasks, and deprecated Subscribe
and Unsubscribe
.ResetAnalyticsData()
to clear all analytics data
for an app from the device.GetAnalyticsInstanceIdAsync()
which allows developers
to retrieve the current app's analytics instance ID.FirebaseUser.LinkAndRetrieveDataWithCredential()
and
FirebaseUser.ReauthenticateAndRetrieveData()
.FirebaseUser.UpdateUserProfile()
.FirebaseMessaging.RequestPermissionAsync()
./System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
.GetBytesAsync
.Firebase.Auth.FirebaseUser.PhotoUrl
.Firebase/m2repository/com/google/firebase/firebase-*-unity/*firebase-*.srcaar
Firebase/m2repository/com/google/firebase/firebase-*-unity/*firebase-*.srcaar
Firebase/m2repository/com/google/firebase/firebase-*-unity/*firebase-*.srcaar
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。