Skip to content

Commit abf77f4

Browse files
committed
Integrate Latest @ 345456564
CL: 345456564
1 parent dab9375 commit abf77f4

File tree

7 files changed

+460
-169
lines changed

7 files changed

+460
-169
lines changed

analytics/testapp/Assets/Firebase/Sample/Analytics/UIHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ void InitializeFirebase() {
6868
// Set the user ID.
6969
FirebaseAnalytics.SetUserId("uber_user_510");
7070
// Set default session duration values.
71-
FirebaseAnalytics.SetMinimumSessionDuration(new TimeSpan(0, 0, 10));
7271
FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
7372
firebaseInitialized = true;
7473
}

database/testapp/Assets/Firebase/Sample/Database/UIHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Firebase.Sample.Database {
1616
using Firebase;
1717
using Firebase.Database;
1818
using Firebase.Extensions;
19-
using Firebase.Unity.Editor;
2019
using System;
2120
using System.Collections;
2221
using System.Collections.Generic;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
// Allows doing builds from the command line.
5+
//
6+
// For more information, see:
7+
// https://docs.unity3d.com/Manual/CommandLineArguments.html
8+
// https://docs.unity3d.com/ScriptReference/BuildOptions.html
9+
// https://docs.unity3d.com/ScriptReference/BuildPipeline.BuildPlayer.html
10+
public class Builder {
11+
12+
public static void BuildIos() {
13+
var options = new BuildPlayerOptions();
14+
15+
options.scenes = new string[] { "Assets/Firebase/Sample/Firestore/MainSceneAutomated.unity" };
16+
options.locationPathName = "ios-build";
17+
options.target = BuildTarget.iOS;
18+
// AcceptExternalModificationsToPlayer corresponds to "Append" in the Unity
19+
// UI -- it allows doing incremental iOS build.
20+
options.options = BuildOptions.AcceptExternalModificationsToPlayer;
21+
// Firebase Unity plugins don't seem to work on a simulator.
22+
PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;
23+
24+
BuildPipeline.BuildPlayer(options);
25+
}
26+
27+
}

firestore/testapp/Assets/Firebase/Sample/Firestore/EventAccumulator.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Linq;
5+
using System.Threading;
46
using System.Threading.Tasks;
57
using UnityEngine;
68

@@ -10,6 +12,12 @@ class EventAccumulator<T> {
1012
private readonly List<T> events = new List<T>();
1113
private int maxEvents = 0;
1214
private bool assertOnAnyEvent = false;
15+
private int mainThreadId = -1;
16+
17+
public EventAccumulator() { }
18+
public EventAccumulator(int mainThreadId) {
19+
this.mainThreadId = mainThreadId;
20+
}
1321

1422
/// <summary>
1523
/// Returns a listener callback suitable for passing to Listen().
@@ -19,7 +27,9 @@ public Action<T> Listener {
1927
return (value) => {
2028
lock (this) {
2129
HardAssert(!assertOnAnyEvent, "Received unexpected event: " + value);
22-
Debug.Log("EventAccumulator Received new event: " + value);
30+
if (mainThreadId > 0) {
31+
HardAssert(1 == Thread.CurrentThread.ManagedThreadId, "Listener callback from non-main thread.");
32+
}
2333
events.Add(value);
2434
CheckFulfilled();
2535
}
@@ -74,7 +84,7 @@ private void CheckFulfilled() {
7484
private void HardAssert(bool condition, string message) {
7585
if (!condition) {
7686
string text = "Assertion Failure: " + message;
77-
Debug.Log(text);
87+
UnityEngine.Debug.Log(text);
7888
throw new Exception(text);
7989
}
8090
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.0</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{E6ACD1E8-3BBF-45DE-A5C3-61A66F843BED}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>Firebase.Sample.Firestore</RootNamespace>
11+
<AssemblyName>Firebase.Sample.Firestore</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
16+
<DebugSymbols>True</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>False</Optimize>
19+
<OutputPath>bin\Debug</OutputPath>
20+
<DefineConstants>DEBUG;</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
<ConsolePause>False</ConsolePause>
24+
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
28+
<DebugSymbols>True</DebugSymbols>
29+
<DebugType>full</DebugType>
30+
<Optimize>True</Optimize>
31+
<OutputPath>bin\Release</OutputPath>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<ConsolePause>False</ConsolePause>
35+
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
</ItemGroup>
41+
<ItemGroup>
42+
<Compile Include="EventAccumulator.cs" />
43+
<Compile Include="SerializationTestData.cs" />
44+
<Compile Include="UIHandler.cs" />
45+
<Compile Include="UIHandlerAutomated.cs" />
46+
</ItemGroup>
47+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
48+
</Project>

0 commit comments

Comments
 (0)