Skip to content

Commit eeac438

Browse files
Googlerchkuang-g
authored andcommitted
Initial import of the Firebase Unity SDK - 383673549 [Unity] Firestore Data Bundles by Googler <noreply@google.com>
- 382361164 Bump up Firebase deps to EDM4U to 1.2.166 by chkuang <chkuang@google.com> - 381504265 Fix an issue with DataSnapshot children being deleted inc... by amaurice <amaurice@google.com> - 380843860 Added a release notes entry for cl/380585575: Add invalid... by Googler <noreply@google.com> - 380662743 Implement IDisposable on ListenerRegistration by Googler <noreply@google.com> - 380588046 Fix link typo to https://github.com/firebase/quickstart-u... by Googler <noreply@google.com> - 379378536 Update the Android and iOS dependencies for Firebase Unity by amaurice <amaurice@google.com> - 378976362 Update the Firestore release notes about exceptions on iOS. by Googler <noreply@google.com> - 378896780 Add a note on how to configure the XCode project for Fire... by Googler <noreply@google.com> - 375712637 Add release notes entry for cl/375130076, which fixed Run... by Googler <noreply@google.com> - 375600358 Exclude releasing folder to open source by cynthiajiang <cynthiajiang@google.com> PiperOrigin-RevId: 383673549
1 parent 08f47af commit eeac438

File tree

80 files changed

+6466
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+6466
-9
lines changed

cmake/android_dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ set(FIREBASE_ANALYTICS_ANDROID_DEPS
2424
)
2525

2626
set(FIREBASE_AUTH_ANDROID_DEPS
27-
"com.google.firebase:firebase-auth:21.0.0"
27+
"com.google.firebase:firebase-auth:21.0.1"
2828
"com.google.firebase:firebase-analytics:19.0.0"
2929
)
3030

database/src/DataSnapshot.cs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,34 @@ public sealed class DataSnapshot {
6767
// We only keeps a reference to the database to ensure that it's kept alive,
6868
// as the underlying C++ code needs that.
6969
private readonly FirebaseDatabase database;
70+
// If the DataSnapshot is created via Child, we want to hold onto a reference of the original
71+
// DataSnapshot that triggered it, to prevent the underlying C++ snapshot from being deleted.
72+
private readonly DataSnapshot parentSnapshot;
73+
// If the DataSnapshot is created via Children, we want to hold onto a reference to the List
74+
// of Children that this originated from, to prevent the underlying C++ list from being deleted.
75+
private readonly DataSnapshotList parentList;
7076

71-
private DataSnapshot(InternalDataSnapshot internalSnapshot, FirebaseDatabase database) {
77+
private DataSnapshot(InternalDataSnapshot internalSnapshot, FirebaseDatabase database,
78+
DataSnapshot parentSnapshot, DataSnapshotList parentList) {
7279
this.internalSnapshot = internalSnapshot;
7380
this.database = database;
81+
this.parentSnapshot = parentSnapshot;
82+
this.parentList = parentList;
7483
}
7584

7685
internal static DataSnapshot CreateSnapshot(
7786
InternalDataSnapshot internalSnapshot, FirebaseDatabase database) {
78-
return new DataSnapshot(internalSnapshot, database);
87+
return new DataSnapshot(internalSnapshot, database, null, null);
88+
}
89+
90+
private static DataSnapshot CreateSnapshot(
91+
InternalDataSnapshot internalSnapshot, FirebaseDatabase database, DataSnapshot parent) {
92+
return new DataSnapshot(internalSnapshot, database, parent, null);
93+
}
94+
95+
private static DataSnapshot CreateSnapshot(
96+
InternalDataSnapshot internalSnapshot, FirebaseDatabase database, DataSnapshotList list) {
97+
return new DataSnapshot(internalSnapshot, database, null, list);
7998
}
8099

81100
/// <summary>Indicates whether this snapshot has any children</summary>
@@ -133,16 +152,19 @@ public string Key {
133152
private sealed class DataSnapshotEnumerator : IEnumerator<DataSnapshot> {
134153
private IEnumerator<InternalDataSnapshot> internalEnumerator;
135154
private FirebaseDatabase database;
155+
private DataSnapshotList parentList;
136156
public DataSnapshotEnumerator(
137-
IEnumerator<InternalDataSnapshot> internalEnumerator, FirebaseDatabase database) {
157+
IEnumerator<InternalDataSnapshot> internalEnumerator, FirebaseDatabase database,
158+
DataSnapshotList parentList) {
138159
this.internalEnumerator = internalEnumerator;
139160
this.database = database;
161+
this.parentList = parentList;
140162
}
141163
public DataSnapshot Current {
142-
get { return CreateSnapshot(internalEnumerator.Current, database); }
164+
get { return CreateSnapshot(internalEnumerator.Current, database, parentList); }
143165
}
144166
object IEnumerator.Current {
145-
get { return CreateSnapshot(internalEnumerator.Current, database); }
167+
get { return CreateSnapshot(internalEnumerator.Current, database, parentList); }
146168
}
147169
public bool MoveNext() {
148170
return internalEnumerator.MoveNext();
@@ -166,10 +188,10 @@ public DataSnapshotList(
166188
this.database = database;
167189
}
168190
public IEnumerator<DataSnapshot> GetEnumerator() {
169-
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database);
191+
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database, this);
170192
}
171193
IEnumerator IEnumerable.GetEnumerator() {
172-
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database);
194+
return new DataSnapshotEnumerator(internalList.GetEnumerator(), database, this);
173195
}
174196
}
175197

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

215237
/// <summary>

docs/analytics/AnalyticsReadme.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Get Started with Google Analytics for Firebase
2+
==============================================
3+
4+
Thank you for installing the Unity Google Analytics for Firebase SDK. The
5+
[Analytics guide](https://firebase.google.com/docs/analytics/unity/start)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
[Google Analytics for Firebase](https://firebase.google.com/products/analytics/)
11+
collects usage and behavior data for your game.
12+
13+
The SDK logs two primary types of information:
14+
* *Events*. What is happening in your game, such as user actions, system events,
15+
or errors.
16+
* *User properties*. Attributes you define to describe segments of your user
17+
base, such as language preference or geographic location.
18+
19+
Google Analytics automatically logs some events and user properties; you don't
20+
need to add any code to enable them. If your app needs to collect additional
21+
data, you can set up to 25 different Analytics user properties and log up to
22+
500 different Analytics event types in your app. There is no limit on the total
23+
volume of events your app logs.
24+
25+
# Using the Sample
26+
27+
This SDK is distributed with a sample project under the
28+
`Assets/Firebase/Sample/Analytics` directory. To configure and run the sample,
29+
follow the instructions in `Assets/Firebase/Sample/Analytics/readme.md`.
30+
31+
# Demos
32+
33+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
34+
which showcases the integration of multiple Firebase features within a single
35+
game. The source is available on
36+
[GitHub](https://github.com/google/mechahamster), and the live application
37+
is available for iOS on the
38+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
39+
and for Android on the
40+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
41+
42+
# Links
43+
44+
* [Homepage](https://firebase.google.com/games/)
45+
* [Contact](https://firebase.google.com/support/contact/)
46+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
47+
48+
# Discussion
49+
50+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
51+
* [Slack community](https://firebase-community.slack.com/)
52+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
53+

docs/analytics/Analytics_icon.png

7.64 KB
Loading

docs/analytics/Analytics_large.png

29.5 KB
Loading

docs/analytics/Analytics_small.png

7.38 KB
Loading

docs/auth/AuthReadme.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Get Started with Firebase Authentication
2+
========================================
3+
4+
Thank you for installing the Firebase Authentication Unity SDK. The
5+
[Authentication guide](https://firebase.google.com/docs/auth/unity/start)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
You can use
11+
[Firebase Authentication](https://firebase.google.com/products/auth/)
12+
to allow users to sign in to your game using one or more sign-in methods,
13+
including email address and password sign-in, and federated identity providers
14+
such as Google Sign-in, and Facebook Login.
15+
16+
# Using the Sample
17+
18+
This SDK is distributed with a sample project under the
19+
`Assets/Firebase/Sample/Auth` directory. To configure and run the sample,
20+
follow the instructions in `Assets/Firebase/Sample/Auth/readme.md`.
21+
22+
# Demos
23+
24+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
25+
which showcases the integration of multiple Firebase features within a single
26+
game. The source is available on
27+
[GitHub](https://github.com/google/mechahamster), and the live application
28+
is available for iOS on the
29+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
30+
and for Android on the
31+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
32+
33+
# Links
34+
35+
* [Homepage](https://firebase.google.com/games/)
36+
* [Contact](https://firebase.google.com/support/contact/)
37+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
38+
39+
# Discussion
40+
41+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
42+
* [Slack community](https://firebase-community.slack.com/)
43+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)

docs/auth/Auth_icon.png

8.07 KB
Loading

docs/auth/Auth_large.png

29.2 KB
Loading

docs/auth/Auth_small.png

7.33 KB
Loading

docs/crashlytics/CrashlyticsReadme.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Get Started with Firebase Crashlytics
2+
========================================
3+
4+
Thank you for installing the Firebase Crashlytics Unity SDK. The
5+
[Crashlytics guide](https://firebase.google.com/docs/crashlytics/get-started)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
You can use
11+
[Firebase Crashlytics](https://firebase.google.com/products/crashlytics/)
12+
to help you track, prioritize, and fix stability issues that erode app quality,
13+
in realtime. Spend less time triaging and troubleshooting crashes and more time
14+
building app features that delight users.
15+
16+
# Using the Sample
17+
18+
This SDK is distributed with a sample project under the
19+
`Assets/Firebase/Sample/Crashlytics` directory. To configure and run the sample,
20+
follow the instructions in `Assets/Firebase/Sample/Crashlytics/readme.md`.
21+
22+
# Demos
23+
24+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
25+
which showcases the integration of multiple Firebase features within a single
26+
game. The source is available on
27+
[GitHub](https://github.com/google/mechahamster), and the live application
28+
is available for iOS on the
29+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
30+
and for Android on the
31+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
32+
33+
# Links
34+
35+
* [Homepage](https://firebase.google.com/games/)
36+
* [Contact](https://firebase.google.com/support/contact/)
37+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
38+
39+
# Discussion
40+
41+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
42+
* [Slack community](https://firebase-community.slack.com/)
43+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)

docs/crashlytics/Crashlytics_icon.png

8.19 KB
Loading
33.7 KB
Loading
6.14 KB
Loading

docs/database/DatabaseReadme.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Get Started with Firebase Realtime Database
2+
===========================================
3+
4+
Thank you for installing the Firebase Realtime Database Unity SDK. The
5+
[Realtime Database guide](https://firebase.google.com/docs/database/unity/start)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
[Firebase Realtime Database](https://firebase.google.com/products/realtime-database/)
11+
stores and synchronizes data with our NoSQL cloud database. Data is synced
12+
across all clients in real time, and remains available when your app goes
13+
offline.
14+
15+
# Using the Sample
16+
17+
This SDK is distributed with a sample project under the
18+
`Assets/Firebase/Sample/Database` directory. To configure and run the sample,
19+
follow the instructions in `Assets/Firebase/Database/Storage/readme.md`.
20+
21+
# Demos
22+
23+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
24+
which showcases the integration of multiple Firebase features within a single
25+
game. The source is available on
26+
[GitHub](https://github.com/google/mechahamster), and the live application
27+
is available for iOS on the
28+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
29+
and for Android on the
30+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
31+
32+
# Links
33+
34+
* [Homepage](https://firebase.google.com/games/)
35+
* [Contact](https://firebase.google.com/support/contact/)
36+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
37+
38+
# Discussion
39+
40+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
41+
* [Slack community](https://firebase-community.slack.com/)
42+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)

docs/database/Database_icon.png

7.87 KB
Loading

docs/database/Database_large.png

27.5 KB
Loading

docs/database/Database_small.png

7.26 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Get Started with Firebase Dynamic Links
2+
========================================
3+
4+
Thank you for installing the Firebase Dynamic Links Unity SDK. The
5+
[Dynamic Links guide](https://firebase.google.com/docs/dynamic-links/unity/create)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
You can use
11+
[Firebase Dynamic Links](https://firebase.google.com/products/dynamic-links/)
12+
to create short or long Dynamic Links. The API takes several optional parameter
13+
structures to build links. Short links can also be created from a previously
14+
generated long link. The Dynamic Links API will generate a URL like
15+
https://example.page.link/aSDf.
16+
17+
18+
# Using the Sample
19+
20+
This SDK is distributed with a sample project under the
21+
`Assets/Firebase/Sample/DynamicLinks` directory. To configure and run the
22+
sample, follow the instructions in
23+
`Assets/Firebase/Sample/DynamicLinks/readme.md`.
24+
25+
# Demos
26+
27+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
28+
which showcases the integration of multiple Firebase features within a single
29+
game. The source is available on
30+
[GitHub](https://github.com/google/mechahamster), and the live application
31+
is available for iOS on the
32+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
33+
and for Android on the
34+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
35+
36+
# Links
37+
38+
* [Homepage](https://firebase.google.com/games/)
39+
* [Contact](https://firebase.google.com/support/contact/)
40+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
41+
42+
# Discussion
43+
44+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
45+
* [Slack community](https://firebase-community.slack.com/)
46+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)
8.17 KB
Loading
30.3 KB
Loading
7.46 KB
Loading

docs/functions/FunctionsReadme.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Get Started with Cloud Functions for Firebase
2+
=============================================
3+
4+
Thank you for installing the Cloud Functions for Firebase Unity SDK. The
5+
[Cloud Functions guide](https://firebase.google.com/docs/functions/callable)
6+
provides instructions to configure a Unity project.
7+
8+
# Overview
9+
10+
You can use
11+
[Cloud Functions for Firebase](https://firebase.google.com/products/functions/)
12+
to you automatically run backend code in response to events triggered by
13+
Firebase features and HTTPS requests. Your code is stored in Google's cloud
14+
and runs in a managed environment. There's no need to manage and scale your own
15+
servers.
16+
17+
# Using the Sample
18+
19+
This SDK is distributed with a sample project under the
20+
`Assets/Firebase/Sample/Functions` directory. To configure and run the sample,
21+
follow the instructions in `Assets/Firebase/Sample/Functions/readme.md`.
22+
23+
# Demos
24+
25+
[Mecha Hamster](https://github.com/google/mechahamster) is provided as a demo
26+
which showcases the integration of multiple Firebase features within a single
27+
game. The source is available on
28+
[GitHub](https://github.com/google/mechahamster), and the live application
29+
is available for iOS on the
30+
[App Store](https://itunes.apple.com/us/app/mechahamster/id1286046770?mt=8&ign-mpt=uo%3D4)
31+
and for Android on the
32+
(Google Play Store)[https://play.google.com/store/apps/details?id=com.google.fpl.mechahamster&hl=en].
33+
34+
# Links
35+
36+
* [Homepage](https://firebase.google.com/games/)
37+
* [Contact](https://firebase.google.com/support/contact/)
38+
* [Unity Quickstart Samples](https://github.com/firebase/quickstart-unity)
39+
40+
# Discussion
41+
42+
* [Stack overflow](https://stackoverflow.com/questions/tagged/firebase)
43+
* [Slack community](https://firebase-community.slack.com/)
44+
* [Google groups](https://groups.google.com/forum/#!forum/firebase-talk)

docs/functions/Functions_icon.png

8.07 KB
Loading

docs/functions/Functions_large.png

33.4 KB
Loading

docs/functions/Functions_small.png

6.32 KB
Loading

0 commit comments

Comments
 (0)