Skip to content

Commit d8bd8bb

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

File tree

81 files changed

+6467
-10
lines changed

Some content is hidden

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

81 files changed

+6467
-10
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

0 commit comments

Comments
 (0)