Skip to content

Sync from internal repo #16

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

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/android_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(FIREBASE_ANALYTICS_ANDROID_DEPS
)

set(FIREBASE_AUTH_ANDROID_DEPS
"com.google.firebase:firebase-auth:21.0.0"
"com.google.firebase:firebase-auth:21.0.1"
"com.google.firebase:firebase-analytics:19.0.0"
)

Expand Down
38 changes: 30 additions & 8 deletions database/src/DataSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,34 @@ public sealed class DataSnapshot {
// We only keeps a reference to the database to ensure that it's kept alive,
// as the underlying C++ code needs that.
private readonly FirebaseDatabase database;
// If the DataSnapshot is created via Child, we want to hold onto a reference of the original
// DataSnapshot that triggered it, to prevent the underlying C++ snapshot from being deleted.
private readonly DataSnapshot parentSnapshot;
// If the DataSnapshot is created via Children, we want to hold onto a reference to the List
// of Children that this originated from, to prevent the underlying C++ list from being deleted.
private readonly DataSnapshotList parentList;

private DataSnapshot(InternalDataSnapshot internalSnapshot, FirebaseDatabase database) {
private DataSnapshot(InternalDataSnapshot internalSnapshot, FirebaseDatabase database,
DataSnapshot parentSnapshot, DataSnapshotList parentList) {
this.internalSnapshot = internalSnapshot;
this.database = database;
this.parentSnapshot = parentSnapshot;
this.parentList = parentList;
}

internal static DataSnapshot CreateSnapshot(
InternalDataSnapshot internalSnapshot, FirebaseDatabase database) {
return new DataSnapshot(internalSnapshot, database);
return new DataSnapshot(internalSnapshot, database, null, null);
}

private static DataSnapshot CreateSnapshot(
InternalDataSnapshot internalSnapshot, FirebaseDatabase database, DataSnapshot parent) {
return new DataSnapshot(internalSnapshot, database, parent, null);
}

private static DataSnapshot CreateSnapshot(
InternalDataSnapshot internalSnapshot, FirebaseDatabase database, DataSnapshotList list) {
return new DataSnapshot(internalSnapshot, database, null, list);
}

/// <summary>Indicates whether this snapshot has any children</summary>
Expand Down Expand Up @@ -133,16 +152,19 @@ public string Key {
private sealed class DataSnapshotEnumerator : IEnumerator<DataSnapshot> {
private IEnumerator<InternalDataSnapshot> internalEnumerator;
private FirebaseDatabase database;
private DataSnapshotList parentList;
public DataSnapshotEnumerator(
IEnumerator<InternalDataSnapshot> internalEnumerator, FirebaseDatabase database) {
IEnumerator<InternalDataSnapshot> internalEnumerator, FirebaseDatabase database,
DataSnapshotList parentList) {
this.internalEnumerator = internalEnumerator;
this.database = database;
this.parentList = parentList;
}
public DataSnapshot Current {
get { return CreateSnapshot(internalEnumerator.Current, database); }
get { return CreateSnapshot(internalEnumerator.Current, database, parentList); }
}
object IEnumerator.Current {
get { return CreateSnapshot(internalEnumerator.Current, database); }
get { return CreateSnapshot(internalEnumerator.Current, database, parentList); }
}
public bool MoveNext() {
return internalEnumerator.MoveNext();
Expand All @@ -166,10 +188,10 @@ public DataSnapshotList(
this.database = database;
}
public IEnumerator<DataSnapshot> GetEnumerator() {
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database);
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database, this);
}
IEnumerator IEnumerable.GetEnumerator() {
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database);
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database, this);
}
}

Expand Down Expand Up @@ -209,7 +231,7 @@ public object Priority {
/// <returns>The DataSnapshot for the child location</returns>
public DataSnapshot Child(string path) {
// Do not use CreateSnapshot here, because we do return an empty DataSnapshot here.
return new DataSnapshot(internalSnapshot.Child(path), database);
return new DataSnapshot(internalSnapshot.Child(path), database, this, null);
}

/// <summary>
Expand Down
53 changes: 53 additions & 0 deletions docs/analytics/AnalyticsReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Get Started with Google Analytics for Firebase
==============================================

Thank you for installing the Unity Google Analytics for Firebase SDK. The
[Analytics guide](https://firebase.google.com/docs/analytics/unity/start)
provides instructions to configure a Unity project.

# Overview

[Google Analytics for Firebase](https://firebase.google.com/products/analytics/)
collects usage and behavior data for your game.

The SDK logs two primary types of information:
* *Events*. What is happening in your game, such as user actions, system events,
or errors.
* *User properties*. Attributes you define to describe segments of your user
base, such as language preference or geographic location.

Google Analytics automatically logs some events and user properties; you don't
need to add any code to enable them. If your app needs to collect additional
data, you can set up to 25 different Analytics user properties and log up to
500 different Analytics event types in your app. There is no limit on the total
volume of events your app logs.

# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/Analytics` directory. To configure and run the sample,
follow the instructions in `Assets/Firebase/Sample/Analytics/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)

Binary file added docs/analytics/Analytics_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics/Analytics_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics/Analytics_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/auth/AuthReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Get Started with Firebase Authentication
========================================

Thank you for installing the Firebase Authentication Unity SDK. The
[Authentication guide](https://firebase.google.com/docs/auth/unity/start)
provides instructions to configure a Unity project.

# Overview

You can use
[Firebase Authentication](https://firebase.google.com/products/auth/)
to allow users to sign in to your game using one or more sign-in methods,
including email address and password sign-in, and federated identity providers
such as Google Sign-in, and Facebook Login.

# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/Auth` directory. To configure and run the sample,
follow the instructions in `Assets/Firebase/Sample/Auth/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
Binary file added docs/auth/Auth_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/auth/Auth_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/auth/Auth_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/crashlytics/CrashlyticsReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Get Started with Firebase Crashlytics
========================================

Thank you for installing the Firebase Crashlytics Unity SDK. The
[Crashlytics guide](https://firebase.google.com/docs/crashlytics/get-started)
provides instructions to configure a Unity project.

# Overview

You can use
[Firebase Crashlytics](https://firebase.google.com/products/crashlytics/)
to help you track, prioritize, and fix stability issues that erode app quality,
in realtime. Spend less time triaging and troubleshooting crashes and more time
building app features that delight users.

# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/Crashlytics` directory. To configure and run the sample,
follow the instructions in `Assets/Firebase/Sample/Crashlytics/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
Binary file added docs/crashlytics/Crashlytics_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/crashlytics/Crashlytics_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/crashlytics/Crashlytics_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/database/DatabaseReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Get Started with Firebase Realtime Database
===========================================

Thank you for installing the Firebase Realtime Database Unity SDK. The
[Realtime Database guide](https://firebase.google.com/docs/database/unity/start)
provides instructions to configure a Unity project.

# Overview

[Firebase Realtime Database](https://firebase.google.com/products/realtime-database/)
stores and synchronizes data with our NoSQL cloud database. Data is synced
across all clients in real time, and remains available when your app goes
offline.

# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/Database` directory. To configure and run the sample,
follow the instructions in `Assets/Firebase/Database/Storage/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
Binary file added docs/database/Database_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database/Database_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database/Database_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/dynamic_links/DynamicLinksReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Get Started with Firebase Dynamic Links
========================================

Thank you for installing the Firebase Dynamic Links Unity SDK. The
[Dynamic Links guide](https://firebase.google.com/docs/dynamic-links/unity/create)
provides instructions to configure a Unity project.

# Overview

You can use
[Firebase Dynamic Links](https://firebase.google.com/products/dynamic-links/)
to create short or long Dynamic Links. The API takes several optional parameter
structures to build links. Short links can also be created from a previously
generated long link. The Dynamic Links API will generate a URL like
https://example.page.link/aSDf.


# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/DynamicLinks` directory. To configure and run the
sample, follow the instructions in
`Assets/Firebase/Sample/DynamicLinks/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
Binary file added docs/dynamic_links/DynamicLinks_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dynamic_links/DynamicLinks_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dynamic_links/DynamicLinks_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions docs/functions/FunctionsReadme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Get Started with Cloud Functions for Firebase
=============================================

Thank you for installing the Cloud Functions for Firebase Unity SDK. The
[Cloud Functions guide](https://firebase.google.com/docs/functions/callable)
provides instructions to configure a Unity project.

# Overview

You can use
[Cloud Functions for Firebase](https://firebase.google.com/products/functions/)
to you automatically run backend code in response to events triggered by
Firebase features and HTTPS requests. Your code is stored in Google's cloud
and runs in a managed environment. There's no need to manage and scale your own
servers.

# Using the Sample

This SDK is distributed with a sample project under the
`Assets/Firebase/Sample/Functions` directory. To configure and run the sample,
follow the instructions in `Assets/Firebase/Sample/Functions/readme.md`.

# Demos

[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
which showcases the integration of multiple Firebase features within a single
game. The source is available on
[GitHub](https://github.com/google/mechahamster), and the live application
is available for iOS on the
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
and for Android on the
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].

# Links

* [Homepage](https://firebase.google.com/games/)
* [Contact](https://firebase.google.com/support/contact/)
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)

# Discussion

* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
* [Slack community](https://firebase-community.slack.com/)
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
Binary file added docs/functions/Functions_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/functions/Functions_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/functions/Functions_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading