Skip to content

Commit b9ba2cc

Browse files
firebase-workflow-trigger[bot]jonsimantovtom-andersenAlmostMatta-maurice
authored
Automatic merge of main into feature_branch/ump-sdk - Sep 04, 2023 (#1438)
* iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae9. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d4. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot <firebase-workflow-trigger-bot@google.com> Co-authored-by: Jon Simantov <jsimantov@google.com> Co-authored-by: almostmatt@google.com <almostmatt@google.com> * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang <cynthiajiang@google.com> * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang <cynthiajiang@google.com> * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls * Add Analytics function for on-device conversion (#1429) * Add Analytics function for phone number conversion * Formatting * Update analytics.h * Update analytics_test.cc * Update mobile dependencies - Tue Aug 29 2023 (#1436) * Update mobile dependencies - Tue Aug 29 2023 ### Android - com.google.android.gms.play_services_ads → 22.3.0 - com.google.firebase.firebase_bom → 32.2.3 ### iOS - Firebase/Analytics → 10.14.0 - Firebase/AppCheck → 10.14.0 - Firebase/Auth → 10.14.0 - Firebase/Core → 10.14.0 - Firebase/CoreOnly → 10.14.0 - Firebase/Crashlytics → 10.14.0 - Firebase/Database → 10.14.0 - Firebase/DynamicLinks → 10.14.0 - Firebase/Firestore → 10.14.0 - Firebase/Functions → 10.14.0 - Firebase/Installations → 10.14.0 - Firebase/Messaging → 10.14.0 - Firebase/RemoteConfig → 10.14.0 - Firebase/Storage → 10.14.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6016988287). * Update query_main to use normalized_order_bys * Update query_main.cc --------- Co-authored-by: firebase-workflow-trigger-bot <firebase-workflow-trigger-bot@google.com> Co-authored-by: a-maurice <amaurice@google.com> * add UseEmulator api to auth (#1437) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change * remove platform logging v1 code * add useEmulator api * test with emulator * clean up for review * tweak for review * update with comments * put back necessary heartbeat blocks --------- Co-authored-by: Cynthia Jiang <cynthiajiang@google.com> --------- Co-authored-by: Jon Simantov <jsimantov@google.com> Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com> Co-authored-by: Matthew Hyndman <almostmatt@google.com> Co-authored-by: a-maurice <amaurice@google.com> Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org> Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot <firebase-workflow-trigger-bot@google.com> Co-authored-by: Cynthia J <cynthiajoan@users.noreply.github.com> Co-authored-by: Cynthia Jiang <cynthiajiang@google.com> Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com>
1 parent 890e829 commit b9ba2cc

File tree

60 files changed

+4419
-3543
lines changed

Some content is hidden

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

60 files changed

+4419
-3543
lines changed

Android/firebase_dependencies.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def firebaseDependenciesMap = [
2727
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
2828
'firestore' : ['com.google.firebase:firebase-firestore'],
2929
'functions' : ['com.google.firebase:firebase-functions'],
30-
'gma' : ['com.google.android.gms:play-services-ads:22.2.0'],
30+
'gma' : ['com.google.android.gms:play-services-ads:22.3.0'],
3131
'installations' : ['com.google.firebase:firebase-installations'],
3232
'invites' : ['com.google.firebase:firebase-invites'],
3333
// Messaging has an additional local dependency to include.
@@ -158,7 +158,7 @@ project.afterEvaluate {
158158

159159
// Add the bill-of-materials
160160
project.dependencies {
161-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
161+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
162162
}
163163
for (Stringlib : firebaseCpp.dependencies.libSet) {
164164
// Generate and include the proguard file

analytics/integration_test/Podfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use_frameworks! :linkage => :static
55

66
target'integration_test'do
77
platform:ios,'11.0'
8-
pod'Firebase/Analytics','10.13.0'
8+
pod'Firebase/Analytics','10.14.0'
99
end
1010

1111
target'integration_test_tvos'do
1212
platform:tvos,'12.0'
13-
pod'Firebase/Analytics','10.13.0'
13+
pod'Firebase/Analytics','10.14.0'
1414
end
1515

1616
post_installdo |installer|

analytics/integration_test/src/integration_test.cc

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ TEST_F(FirebaseAnalyticsTest, TestSetProperties) {
190190
// Initiate on-device conversion measurement.
191191
firebase::analytics::InitiateOnDeviceConversionMeasurementWithEmailAddress(
192192
"my_email@site.com");
193+
firebase::analytics::InitiateOnDeviceConversionMeasurementWithPhoneNumber(
194+
"+15551234567");
193195
}
194196

195197
TEST_F(FirebaseAnalyticsTest, TestLogEvents) {

analytics/ios_headers/FIREventNames.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.13.0.
3+
// Copied from Firebase Analytics iOS SDK 10.14.0.
44

55
/// @file FIREventNames.h
66
///

analytics/ios_headers/FIRParameterNames.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.13.0.
3+
// Copied from Firebase Analytics iOS SDK 10.14.0.
44

55
/// @file FIRParameterNames.h
66
///

analytics/ios_headers/FIRUserPropertyNames.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.13.0.
3+
// Copied from Firebase Analytics iOS SDK 10.14.0.
44

55
/// @file FIRUserPropertyNames.h
66
///

analytics/src/analytics_android.cc

+10
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,16 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
411411
// No-op on Android
412412
}
413413

414+
/// Initiates on-device conversion measurement given a phone number on iOS
415+
/// (no-op on Android). On iOS, requires dependency
416+
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
417+
/// no-op.
418+
voidInitiateOnDeviceConversionMeasurementWithPhoneNumber(
419+
constchar* phone_number) {
420+
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
421+
// No-op on Android
422+
}
423+
414424
// Set a user property to the given value.
415425
voidSetUserProperty(constchar* name, constchar* value) {
416426
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());

analytics/src/analytics_ios.mm

+8
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(const char* email_add
266266
[FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:@(email_address)];
267267
}
268268

269+
/// Initiates on-device conversion measurement given a phone number on iOS (no-op on
270+
/// Android). On iOS, requires dependency GoogleAppMeasurementOnDeviceConversion to be linked
271+
/// in, otherwise it is a no-op.
272+
voidInitiateOnDeviceConversionMeasurementWithPhoneNumber(constchar* phone_number) {
273+
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
274+
[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:@(phone_number)];
275+
}
276+
269277
// Set a user property to the given value.
270278
voidSetUserProperty(constchar* name, constchar* value) {
271279
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());

analytics/src/analytics_stub.cc

+9
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
106106
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
107107
}
108108

109+
/// Initiates on-device conversion measurement given a phone number on iOS
110+
/// (no-op on Android). On iOS, requires dependency
111+
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
112+
/// no-op.
113+
voidInitiateOnDeviceConversionMeasurementWithPhoneNumber(
114+
constchar* phone_number) {
115+
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
116+
}
117+
109118
// Set a user property to the given value.
110119
voidSetUserProperty(constchar* /*name*/, constchar* /*value*/) {
111120
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());

analytics/src/include/firebase/analytics.h

+11
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,17 @@ void LogEvent(const char* name, const Parameter* parameters,
487487
voidInitiateOnDeviceConversionMeasurementWithEmailAddress(
488488
constchar* email_address);
489489

490+
/// Initiates on-device conversion measurement given a phone number in E.164
491+
/// format on iOS (no-op on Android). On iOS, requires dependency
492+
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
493+
/// no-op.
494+
/// @param phone_number User phone number. Must be in E.164 format, which means
495+
/// it must be
496+
/// limited to a maximum of 15 digits and must include a plus sign (+) prefix
497+
/// and country code with no dashes, parentheses, or spaces.
498+
voidInitiateOnDeviceConversionMeasurementWithPhoneNumber(
499+
constchar* phone_number);
500+
490501
/// @brief Set a user property to the given value.
491502
///
492503
/// Properties associated with a user allow a developer to segment users

analytics/src_ios/fake/FIRAnalytics.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
+ (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(nonnull NSString *)emailAddress;
2525

26+
+ (void)InitiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber;
27+
2628
+ (void)setUserPropertyString:(nullable NSString *)valueforName:(nonnull NSString *)name;
2729

2830
+ (void)setUserID:(nullable NSString *)userID;

analytics/src_ios/fake/FIRAnalytics.mm

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ + (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(nonnull NSString
6060
{ [emailAddress UTF8String] });
6161
}
6262

63+
+ (void)initiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber {
64+
FakeReporter->AddReport("+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]",
65+
{ [phoneNumber UTF8String] });
66+
}
67+
6368
+ (void)setUserPropertyString:(nullable NSString *)valueforName:(nonnull NSString *)name {
6469
FakeReporter->AddReport("+[FIRAnalytics setUserPropertyString:forName:]",
6570
{ [name UTF8String], value ? [value UTF8String] : "nil" });

analytics/tests/analytics_test.cc

+10
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ TEST_F(AnalyticsTest,
232232
InitiateOnDeviceConversionMeasurementWithEmailAddress("my_email");
233233
}
234234

235+
TEST_F(AnalyticsTest,
236+
TestInitiateOnDeviceConversionMeasurementWithPhoneNumber) {
237+
// InitiateOnDeviceConversionMeasurementWithPhoneNumber is no-op on Android
238+
AddExpectationApple(
239+
"+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]",
240+
{"+15551234567"});
241+
242+
InitiateOnDeviceConversionMeasurementWithPhoneNumber("+15551234567");
243+
}
244+
235245
TEST_F(AnalyticsTest, TestSetUserProperty) {
236246
AddExpectationAndroid("FirebaseAnalytics.setUserProperty",
237247
{"my_property", "my_value"});

app/app_resources/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
53+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
5454
implementation 'com.google.firebase:firebase-analytics'
5555
}
5656

app/google_api_resources/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
56+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
5757
implementation 'com.google.firebase:firebase-analytics'
5858
implementation 'com.google.android.gms:play-services-base:18.2.0'
5959
implementation project(':app:app_resources')

app/integration_test/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ platform :ios, '11.0'
44
use_frameworks!:linkage=>:static
55

66
target'integration_test'do
7-
pod'Firebase/Analytics','10.13.0'
7+
pod'Firebase/Analytics','10.14.0'
88
end
99

1010
post_installdo |installer|

app/invites_resources/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-dynamic-links'
5555
implementation project(':app:app_resources')

app_check/app_check_resources/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
5353
implementation 'com.google.firebase:firebase-appcheck'
5454
}
5555

app_check/integration_test/Podfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ use_frameworks! :linkage => :static
44

55
target'integration_test'do
66
platform:ios,'11.0'
7-
pod'Firebase/AppCheck','10.13.0'
8-
pod'Firebase/Database','10.13.0'
9-
pod'Firebase/Auth','10.13.0'
10-
pod'Firebase/Storage','10.13.0'
11-
pod'Firebase/Functions','10.13.0'
7+
pod'Firebase/AppCheck','10.14.0'
8+
pod'Firebase/Database','10.14.0'
9+
pod'Firebase/Auth','10.14.0'
10+
pod'Firebase/Storage','10.14.0'
11+
pod'Firebase/Functions','10.14.0'
1212
end
1313

1414
target'integration_test_tvos'do
1515
platform:tvos,'12.0'
16-
pod'Firebase/AppCheck','10.13.0'
17-
pod'Firebase/Database','10.13.0'
18-
pod'Firebase/Auth','10.13.0'
19-
pod'Firebase/Storage','10.13.0'
20-
pod'Firebase/Functions','10.13.0'
16+
pod'Firebase/AppCheck','10.14.0'
17+
pod'Firebase/Database','10.14.0'
18+
pod'Firebase/Auth','10.14.0'
19+
pod'Firebase/Storage','10.14.0'
20+
pod'Firebase/Functions','10.14.0'
2121
end
2222

2323
post_installdo |installer|

auth/auth_resources/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.2.2')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.3')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-auth'
5555
implementation project(':app:app_resources')

auth/integration_test/Podfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use_frameworks! :linkage => :static
44

55
target'integration_test'do
66
platform:ios,'11.0'
7-
pod'Firebase/Auth','10.13.0'
7+
pod'Firebase/Auth','10.14.0'
88
end
99

1010
target'integration_test_tvos'do
1111
platform:tvos,'12.0'
12-
pod'Firebase/Auth','10.13.0'
12+
pod'Firebase/Auth','10.14.0'
1313
end
1414

1515
post_installdo |installer|

auth/src/android/auth_android.cc

+15-8
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,19 @@ void UpdateCurrentUser(AuthData* auth_data) {
188188
}
189189
}
190190

191+
voidSetEmulatorJni(AuthData* auth_data, constchar* host, uint32_t port) {
192+
JNIEnv* env = Env(auth_data);
193+
194+
jstring j_host = env->NewStringUTF(host);
195+
env->CallVoidMethod(AuthImpl(auth_data),
196+
auth::GetMethodId(auth::kUseEmulator), j_host, port);
197+
env->DeleteLocalRef(j_host);
198+
firebase::util::CheckAndClearJniExceptions(env);
199+
}
200+
191201
constchar* constkEmulatorLocalHost = "10.0.2.2";
192202
constchar* constkEmulatorPort = "9099";
193203
voidCheckEmulator(AuthData* auth_data) {
194-
JNIEnv* env = Env(auth_data);
195-
196204
// Use emulator as long as this env variable is set, regardless its value.
197205
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
198206
LogInfo("Using Auth Prod for testing.");
@@ -207,12 +215,7 @@ void CheckEmulator(AuthData* auth_data) {
207215
if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) {
208216
port = std::stoi(std::getenv("AUTH_EMULATOR_PORT"));
209217
}
210-
211-
jstring j_host = env->NewStringUTF(kEmulatorLocalHost);
212-
env->CallVoidMethod(AuthImpl(auth_data),
213-
auth::GetMethodId(auth::kUseEmulator), j_host, port);
214-
env->DeleteLocalRef(j_host);
215-
firebase::util::CheckAndClearJniExceptions(env);
218+
SetEmulatorJni(auth_data, kEmulatorLocalHost, port);
216219
}
217220

218221
// Release cached Java classes.
@@ -828,6 +831,10 @@ Future<void> Auth::SendPasswordResetEmail(const char* email) {
828831
returnMakeFuture(&futures, handle);
829832
}
830833

834+
voidAuth::UseEmulator(std::string host, uint32_t port) {
835+
SetEmulatorJni(auth_data_, host.c_str(), port);
836+
}
837+
831838
// Not implemented for Android.
832839
voidEnableTokenAutoRefresh(AuthData* auth_data) {}
833840
voidDisableTokenAutoRefresh(AuthData* auth_data) {}

auth/src/desktop/auth_desktop.cc

+8
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,14 @@ void Auth::UseAppLanguage() {
715715
auth_impl->language_code.assign(empty_string);
716716
}
717717

718+
voidAuth::UseEmulator(std::string host, uint32_t port) {
719+
auto auth_impl = static_cast<AuthImpl*>(auth_data_->auth_impl);
720+
auth_impl->assigned_emulator_url = "";
721+
auth_impl->assigned_emulator_url.append(host);
722+
auth_impl->assigned_emulator_url.append(":");
723+
auth_impl->assigned_emulator_url.append(std::to_string(port));
724+
}
725+
718726
voidInitializeTokenRefresher(AuthData* auth_data) {
719727
auto auth_impl = static_cast<AuthImpl*>(auth_data->auth_impl);
720728
auth_impl->token_refresh_thread.Initialize(auth_data);

auth/src/desktop/auth_desktop.h

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ struct AuthImpl {
188188
// The current user language code. This can be set to the app’s current
189189
// language by calling SetLanguageCode.
190190
std::string language_code;
191+
192+
std::string assigned_emulator_url;
191193
};
192194

193195
// Constant, describing how often we automatically fetch a new auth token.

0 commit comments

Comments
 (0)
close