Skip to content

Commit f0eca57

Browse files
author
Stewart Miles
committed
Integrate Latest @ 189254663
- Added progress listener and cancellation token to GetBytesAsync() - Do not enable the Storage sample's UI until Firebase is initialized. - Don't copy the GvhProjectSetting.xml file -- not necessary and the file is missing. - Fixed editor crash when UIHandler.storage becomes null. - Fixed race condition in upload / download cancellation. - Fleshed out storage sample to exercise out the entire API. - Modified Storage Unity sample to work with arbitrary user supplied URLs. - Changes for test automation. CL: 189254663
1 parent 69f16b6 commit f0eca57

File tree

15 files changed

+559
-112
lines changed

15 files changed

+559
-112
lines changed

analytics/testapp/Assets/TestApp/UIHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class UIHandler : MonoBehaviour {
3333
private string logText = "";
3434
const int kMaxLogSize = 16382;
3535
DependencyStatus dependencyStatus = DependencyStatus.UnavailableOther;
36+
protected bool firebaseInitialized = false;
3637

3738
// When the app starts, check to make sure that we have
3839
// the required dependencies to use Firebase, and if not,
@@ -68,6 +69,7 @@ void InitializeFirebase() {
6869
"Google");
6970
// Set the user ID.
7071
FirebaseAnalytics.SetUserId("uber_user_510");
72+
firebaseInitialized = true;
7173
}
7274

7375
// End our analytics session when the program exits.

analytics/testapp/ProjectSettings/ProjectSettings.asset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ PlayerSettings:
162162
iOSLaunchScreeniPadCustomXibPath:
163163
iOSDeviceRequirements: []
164164
iOSURLSchemes: []
165+
appleDeveloperTeamID:
166+
iOSManualSigningProvisioningProfileID:
167+
tvOSManualSigningProvisioningProfileID:
168+
appleEnableAutomaticSigning: 1
165169
AndroidTargetDevice: 0
166170
AndroidSplashScreenScale: 0
167171
androidSplashScreen: {fileID: 0}

auth/testapp/Assets/TestApp/UIHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class UIHandler : MonoBehaviour {
2727

2828
protected Firebase.Auth.FirebaseAuth auth;
29-
private Firebase.Auth.FirebaseAuth otherAuth;
29+
protected Firebase.Auth.FirebaseAuth otherAuth;
3030
protected Dictionary<string, Firebase.Auth.FirebaseUser> userByAuth =
3131
new Dictionary<string, Firebase.Auth.FirebaseUser>();
3232

@@ -79,7 +79,7 @@ public virtual void Start() {
7979
}
8080

8181
// Handle initialization of the necessary firebase modules:
82-
void InitializeFirebase() {
82+
protected void InitializeFirebase() {
8383
DebugLog("Setting up Firebase Auth");
8484
auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
8585
auth.StateChanged += AuthStateChanged;

auth/testapp/ProjectSettings/ProjectSettings.asset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ PlayerSettings:
162162
iOSLaunchScreeniPadCustomXibPath:
163163
iOSDeviceRequirements: []
164164
iOSURLSchemes: []
165+
appleDeveloperTeamID:
166+
iOSManualSigningProvisioningProfileID:
167+
tvOSManualSigningProvisioningProfileID:
168+
appleEnableAutomaticSigning: 1
165169
AndroidTargetDevice: 0
166170
AndroidSplashScreenScale: 0
167171
androidSplashScreen: {fileID: 0}

database/testapp/Assets/TestApp/UIHandler.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// startup.
2828
public class UIHandler : MonoBehaviour {
2929

30-
ArrayList leaderBoard;
30+
ArrayList leaderBoard = new ArrayList();
3131
Vector2 scrollPosition = Vector2.zero;
3232
private Vector2 controlsScrollViewVector = Vector2.zero;
3333

@@ -38,16 +38,16 @@ public class UIHandler : MonoBehaviour {
3838
private string email = "";
3939
private int score = 100;
4040
private Vector2 scrollViewVector = Vector2.zero;
41-
bool UIEnabled = true;
41+
protected bool UIEnabled = true;
4242

4343
const int kMaxLogSize = 16382;
4444
DependencyStatus dependencyStatus = DependencyStatus.UnavailableOther;
4545

4646
// When the app starts, check to make sure that we have
4747
// the required dependencies to use Firebase, and if not,
4848
// add them if possible.
49-
void Start() {
50-
leaderBoard = new ArrayList();
49+
protected virtual void Start() {
50+
leaderBoard.Clear();
5151
leaderBoard.Add("Firebase Top " + MaxScores.ToString() + " Scores");
5252

5353
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
@@ -66,7 +66,7 @@ protected virtual void InitializeFirebase() {
6666
FirebaseApp app = FirebaseApp.DefaultInstance;
6767
// NOTE: You'll need to replace this url with your Firebase App's database
6868
// path in order for the database connection to work correctly in editor.
69-
app.SetEditorDatabaseUrl("https://replace-with-your-project.firebaseio.com/");
69+
app.SetEditorDatabaseUrl("https://unity-test-app-fc4db.firebaseio.com/");
7070
if (app.Options.DatabaseUrl != null) app.SetEditorDatabaseUrl(app.Options.DatabaseUrl);
7171
StartListener();
7272
}
@@ -102,7 +102,7 @@ protected void StartListener() {
102102
}
103103

104104
// Exit if escape (or back, on mobile) is pressed.
105-
void Update() {
105+
protected virtual void Update() {
106106
if (Input.GetKeyDown(KeyCode.Escape)) {
107107
Application.Quit();
108108
}

database/testapp/ProjectSettings/ProjectSettings.asset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ PlayerSettings:
162162
iOSLaunchScreeniPadCustomXibPath:
163163
iOSDeviceRequirements: []
164164
iOSURLSchemes: []
165+
appleDeveloperTeamID:
166+
iOSManualSigningProvisioningProfileID:
167+
tvOSManualSigningProvisioningProfileID:
168+
appleEnableAutomaticSigning: 1
165169
AndroidTargetDevice: 0
166170
AndroidSplashScreenScale: 0
167171
androidSplashScreen: {fileID: 0}

dynamic_links/testapp/Assets/TestApp/UIHandler.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ public class UIHandler : MonoBehaviour {
4141
"* Click on the Dynamic Links tab\n" +
4242
"* Copy the domain e.g x20yz.app.goo.gl\n" +
4343
"* Replace the value of kDynamicLinksDomain with the copied domain.\n";
44+
public bool firebaseInitialized = false;
4445

4546
// IMPORTANT: You need to set this to a valid domain from the Firebase
4647
// console (see kDynamicLinksDomainInvalidError for the details).
47-
public string kDynamicLinksDomain = kInvalidDynamicLinksDomain;
48+
public string kDynamicLinksDomain = "f87nv.app.goo.gl";
4849

4950
// When the app starts, check to make sure that we have
5051
// the required dependencies to use Firebase, and if not,
5152
// add them if possible.
52-
void Start() {
53+
public void Start() {
5354
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
5455
dependencyStatus = task.Result;
5556
if (dependencyStatus == DependencyStatus.Available) {
@@ -71,6 +72,7 @@ public void Update() {
7172
// Handle initialization of the necessary firebase modules:
7273
void InitializeFirebase() {
7374
DynamicLinks.DynamicLinkReceived += OnDynamicLink;
75+
firebaseInitialized = true;
7476
}
7577

7678
void OnDestroy() {
@@ -113,6 +115,12 @@ void GUIDisplayLog() {
113115
}
114116

115117
DynamicLinkComponents CreateDynamicLinkComponents() {
118+
#if UNITY_5_6_OR_NEWER
119+
string appIdentifier = Application.identifier;
120+
#else
121+
string appIdentifier = Application.bundleIdentifier;
122+
#endif
123+
116124
return new DynamicLinkComponents(
117125
// The base Link.
118126
new System.Uri("https://google.com/abc"),
@@ -138,7 +146,7 @@ DynamicLinkComponents CreateDynamicLinkComponents() {
138146
CampaignToken = "hijklmno",
139147
ProviderToken = "pq-rstuv"
140148
},
141-
AndroidParameters = new Firebase.DynamicLinks.AndroidParameters(Application.bundleIdentifier) {
149+
AndroidParameters = new Firebase.DynamicLinks.AndroidParameters(appIdentifier) {
142150
FallbackUrl = new System.Uri("https://mysite/fallback"),
143151
MinimumVersion = 12
144152
},

dynamic_links/testapp/ProjectSettings/ProjectSettings.asset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ PlayerSettings:
162162
iOSLaunchScreeniPadCustomXibPath:
163163
iOSDeviceRequirements: []
164164
iOSURLSchemes: []
165+
appleDeveloperTeamID:
166+
iOSManualSigningProvisioningProfileID:
167+
tvOSManualSigningProvisioningProfileID:
168+
appleEnableAutomaticSigning: 1
165169
AndroidTargetDevice: 0
166170
AndroidSplashScreenScale: 0
167171
androidSplashScreen: {fileID: 0}

invites/testapp/Assets/TestApp/UIHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class UIHandler : MonoBehaviour {
3030
private string logText = "";
3131
const int kMaxLogSize = 16382;
3232
Firebase.DependencyStatus dependencyStatus = Firebase.DependencyStatus.UnavailableOther;
33+
public bool firebaseInitialized = false;
3334

3435
// When the app starts, check to make sure that we have
3536
// the required dependencies to use Firebase, and if not,
@@ -53,6 +54,7 @@ void InitializeFirebase() {
5354
Firebase.Invites.FirebaseInvites.InviteNotReceived += OnInviteNotReceived;
5455
Firebase.Invites.FirebaseInvites.ErrorReceived += OnErrorReceived;
5556
DebugLog("Invites initialized");
57+
firebaseInitialized = true;
5658
}
5759

5860
// Exit if escape (or back, on mobile) is pressed.

invites/testapp/ProjectSettings/ProjectSettings.asset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ PlayerSettings:
162162
iOSLaunchScreeniPadCustomXibPath:
163163
iOSDeviceRequirements: []
164164
iOSURLSchemes: []
165+
appleDeveloperTeamID:
166+
iOSManualSigningProvisioningProfileID:
167+
tvOSManualSigningProvisioningProfileID:
168+
appleEnableAutomaticSigning: 1
165169
AndroidTargetDevice: 0
166170
AndroidSplashScreenScale: 0
167171
androidSplashScreen: {fileID: 0}

0 commit comments

Comments
 (0)