Skip to content

Automatic merge of main into feature_branch/ump-sdk - Sep 04, 2023 #1438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e0c330d
iOS: Remove Analytics dependency from GMA integration test (#1386)
jonsimantov Jul 19, 2023
3cd0dca
Add stub workflow for updating feature branches.
jonsimantov Jul 20, 2023
00eeac8
Add script to merge main into all active feature branches on a regula…
jonsimantov Jul 23, 2023
b5e5477
Increase retry. (#1402)
jonsimantov Jul 24, 2023
b9a53cf
Add Firestore test history report (#1403)
jonsimantov Jul 25, 2023
daf92c8
Revert "OR Query Implementation (#1335)" (#1399)
tom-andersen Jul 28, 2023
27a10bc
Wrap the real-time RemoteConfig test in flaky-block to automatically …
AlmostMatt Jul 31, 2023
ed42949
Merge branch 'feature_branch/ump-sdk' into main
jonsimantov Jul 31, 2023
9ac8881
Update the iOS version used by FTL (#1408)
a-maurice Jul 31, 2023
f8b6a36
Kick off nightly packaging an hour earlier (#1409)
a-maurice Aug 2, 2023
18367c0
Fix crash on gma::Initialize without a Firebase App (#1320)
AlmostMatt Aug 2, 2023
505f12e
build: pass along the CMake path (#1410)
compnerd Aug 3, 2023
5df80a2
Add log to gsutil fetch. (#1411)
jonsimantov Aug 3, 2023
3002ff4
Update mobile dependencies - Thu Aug 03 2023 (#1413)
firebase-workflow-trigger[bot] Aug 6, 2023
f198c6f
feat(auth): Add emulator support (#1400)
cynthiajoan Aug 6, 2023
f84253e
Update merge-to-main script (#1420)
jonsimantov Aug 7, 2023
64d5d42
Update release version number for M135, 11.4.0 (#1421)
AlmostMatt Aug 8, 2023
669b0fb
feat(auth): enable emulator support on desktop (#1423)
cynthiajoan Aug 10, 2023
86198bb
Internal Updates. (#1422)
nakirekommula Aug 10, 2023
7a19a44
Add Analytics function for on-device conversion (#1429)
a-maurice Aug 21, 2023
ca5cdee
Update mobile dependencies - Tue Aug 29 2023 (#1436)
firebase-workflow-trigger[bot] Aug 30, 2023
f55c43c
add UseEmulator api to auth (#1437)
cynthiajoan Aug 31, 2023
bdbd134
Merge branch 'feature_branch/ump-sdk' into workflow/auto-merge-featur…
jonsimantov Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def firebaseDependenciesMap = [
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
'firestore' : ['com.google.firebase:firebase-firestore'],
'functions' : ['com.google.firebase:firebase-functions'],
'gma' : ['com.google.android.gms:play-services-ads:22.2.0'],
'gma' : ['com.google.android.gms:play-services-ads:22.3.0'],
'installations' : ['com.google.firebase:firebase-installations'],
'invites' : ['com.google.firebase:firebase-invites'],
// Messaging has an additional local dependency to include.
Expand Down Expand Up @@ -158,7 +158,7 @@ project.afterEvaluate {

// Add the bill-of-materials
project.dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
}
for (String lib : firebaseCpp.dependencies.libSet) {
// Generate and include the proguard file
Expand Down
4 changes: 2 additions & 2 deletions analytics/integration_test/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '11.0'
pod 'Firebase/Analytics', '10.13.0'
pod 'Firebase/Analytics', '10.14.0'
end

target 'integration_test_tvos' do
platform :tvos, '12.0'
pod 'Firebase/Analytics', '10.13.0'
pod 'Firebase/Analytics', '10.14.0'
end

post_install do |installer|
Expand Down
2 changes: 2 additions & 0 deletions analytics/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ TEST_F(FirebaseAnalyticsTest, TestSetProperties) {
// Initiate on-device conversion measurement.
firebase::analytics::InitiateOnDeviceConversionMeasurementWithEmailAddress(
"my_email@site.com");
firebase::analytics::InitiateOnDeviceConversionMeasurementWithPhoneNumber(
"+15551234567");
}

TEST_F(FirebaseAnalyticsTest, TestLogEvents) {
Expand Down
2 changes: 1 addition & 1 deletion analytics/ios_headers/FIREventNames.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2023 Google LLC

// Copied from Firebase Analytics iOS SDK 10.13.0.
// Copied from Firebase Analytics iOS SDK 10.14.0.

/// @file FIREventNames.h
///
Expand Down
2 changes: 1 addition & 1 deletion analytics/ios_headers/FIRParameterNames.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2023 Google LLC

// Copied from Firebase Analytics iOS SDK 10.13.0.
// Copied from Firebase Analytics iOS SDK 10.14.0.

/// @file FIRParameterNames.h
///
Expand Down
2 changes: 1 addition & 1 deletion analytics/ios_headers/FIRUserPropertyNames.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2023 Google LLC

// Copied from Firebase Analytics iOS SDK 10.13.0.
// Copied from Firebase Analytics iOS SDK 10.14.0.

/// @file FIRUserPropertyNames.h
///
Expand Down
10 changes: 10 additions & 0 deletions analytics/src/analytics_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,16 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
// No-op on Android
}

/// Initiates on-device conversion measurement given a phone number on iOS
/// (no-op on Android). On iOS, requires dependency
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
/// no-op.
void InitiateOnDeviceConversionMeasurementWithPhoneNumber(
const char* phone_number) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
// No-op on Android
}

// Set a user property to the given value.
void SetUserProperty(const char* name, const char* value) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
Expand Down
8 changes: 8 additions & 0 deletions analytics/src/analytics_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(const char* email_add
[FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:@(email_address)];
}

/// Initiates on-device conversion measurement given a phone number on iOS (no-op on
/// Android). On iOS, requires dependency GoogleAppMeasurementOnDeviceConversion to be linked
/// in, otherwise it is a no-op.
void InitiateOnDeviceConversionMeasurementWithPhoneNumber(const char* phone_number) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:@(phone_number)];
}

// Set a user property to the given value.
void SetUserProperty(const char* name, const char* value) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
Expand Down
9 changes: 9 additions & 0 deletions analytics/src/analytics_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
}

/// Initiates on-device conversion measurement given a phone number on iOS
/// (no-op on Android). On iOS, requires dependency
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
/// no-op.
void InitiateOnDeviceConversionMeasurementWithPhoneNumber(
const char* phone_number) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
}

// Set a user property to the given value.
void SetUserProperty(const char* /*name*/, const char* /*value*/) {
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
Expand Down
11 changes: 11 additions & 0 deletions analytics/src/include/firebase/analytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,17 @@ void LogEvent(const char* name, const Parameter* parameters,
void InitiateOnDeviceConversionMeasurementWithEmailAddress(
const char* email_address);

/// Initiates on-device conversion measurement given a phone number in E.164
/// format on iOS (no-op on Android). On iOS, requires dependency
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
/// no-op.
/// @param phone_number User phone number. Must be in E.164 format, which means
/// it must be
/// limited to a maximum of 15 digits and must include a plus sign (+) prefix
/// and country code with no dashes, parentheses, or spaces.
void InitiateOnDeviceConversionMeasurementWithPhoneNumber(
const char* phone_number);

/// @brief Set a user property to the given value.
///
/// Properties associated with a user allow a developer to segment users
Expand Down
2 changes: 2 additions & 0 deletions analytics/src_ios/fake/FIRAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

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

+ (void)InitiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber;

+ (void)setUserPropertyString:(nullable NSString *)value forName:(nonnull NSString *)name;

+ (void)setUserID:(nullable NSString *)userID;
Expand Down
5 changes: 5 additions & 0 deletions analytics/src_ios/fake/FIRAnalytics.mm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ + (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(nonnull NSString
{ [emailAddress UTF8String] });
}

+ (void)initiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber {
FakeReporter->AddReport("+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]",
{ [phoneNumber UTF8String] });
}

+ (void)setUserPropertyString:(nullable NSString *)value forName:(nonnull NSString *)name {
FakeReporter->AddReport("+[FIRAnalytics setUserPropertyString:forName:]",
{ [name UTF8String], value ? [value UTF8String] : "nil" });
Expand Down
10 changes: 10 additions & 0 deletions analytics/tests/analytics_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ TEST_F(AnalyticsTest,
InitiateOnDeviceConversionMeasurementWithEmailAddress("my_email");
}

TEST_F(AnalyticsTest,
TestInitiateOnDeviceConversionMeasurementWithPhoneNumber) {
// InitiateOnDeviceConversionMeasurementWithPhoneNumber is no-op on Android
AddExpectationApple(
"+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]",
{"+15551234567"});

InitiateOnDeviceConversionMeasurementWithPhoneNumber("+15551234567");
}

TEST_F(AnalyticsTest, TestSetUserProperty) {
AddExpectationAndroid("FirebaseAnalytics.setUserProperty",
{"my_property", "my_value"});
Expand Down
2 changes: 1 addition & 1 deletion app/app_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation 'com.google.firebase:firebase-analytics'
}

Expand Down
2 changes: 1 addition & 1 deletion app/google_api_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-base:18.2.0'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app/integration_test/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform :ios, '11.0'
use_frameworks! :linkage => :static

target 'integration_test' do
pod 'Firebase/Analytics', '10.13.0'
pod 'Firebase/Analytics', '10.14.0'
end

post_install do |installer|
Expand Down
2 changes: 1 addition & 1 deletion app/invites_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app_check/app_check_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation 'com.google.firebase:firebase-appcheck'
}

Expand Down
20 changes: 10 additions & 10 deletions app_check/integration_test/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '11.0'
pod 'Firebase/AppCheck', '10.13.0'
pod 'Firebase/Database', '10.13.0'
pod 'Firebase/Auth', '10.13.0'
pod 'Firebase/Storage', '10.13.0'
pod 'Firebase/Functions', '10.13.0'
pod 'Firebase/AppCheck', '10.14.0'
pod 'Firebase/Database', '10.14.0'
pod 'Firebase/Auth', '10.14.0'
pod 'Firebase/Storage', '10.14.0'
pod 'Firebase/Functions', '10.14.0'
end

target 'integration_test_tvos' do
platform :tvos, '12.0'
pod 'Firebase/AppCheck', '10.13.0'
pod 'Firebase/Database', '10.13.0'
pod 'Firebase/Auth', '10.13.0'
pod 'Firebase/Storage', '10.13.0'
pod 'Firebase/Functions', '10.13.0'
pod 'Firebase/AppCheck', '10.14.0'
pod 'Firebase/Database', '10.14.0'
pod 'Firebase/Auth', '10.14.0'
pod 'Firebase/Storage', '10.14.0'
pod 'Firebase/Functions', '10.14.0'
end

post_install do |installer|
Expand Down
2 changes: 1 addition & 1 deletion auth/auth_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.2.2')
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation project(':app:app_resources')
Expand Down
4 changes: 2 additions & 2 deletions auth/integration_test/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '11.0'
pod 'Firebase/Auth', '10.13.0'
pod 'Firebase/Auth', '10.14.0'
end

target 'integration_test_tvos' do
platform :tvos, '12.0'
pod 'Firebase/Auth', '10.13.0'
pod 'Firebase/Auth', '10.14.0'
end

post_install do |installer|
Expand Down
23 changes: 15 additions & 8 deletions auth/src/android/auth_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,19 @@ void UpdateCurrentUser(AuthData* auth_data) {
}
}

void SetEmulatorJni(AuthData* auth_data, const char* host, uint32_t port) {
JNIEnv* env = Env(auth_data);

jstring j_host = env->NewStringUTF(host);
env->CallVoidMethod(AuthImpl(auth_data),
auth::GetMethodId(auth::kUseEmulator), j_host, port);
env->DeleteLocalRef(j_host);
firebase::util::CheckAndClearJniExceptions(env);
}

const char* const kEmulatorLocalHost = "10.0.2.2";
const char* const kEmulatorPort = "9099";
void CheckEmulator(AuthData* auth_data) {
JNIEnv* env = Env(auth_data);

// Use emulator as long as this env variable is set, regardless its value.
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
LogInfo("Using Auth Prod for testing.");
Expand All @@ -207,12 +215,7 @@ void CheckEmulator(AuthData* auth_data) {
if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) {
port = std::stoi(std::getenv("AUTH_EMULATOR_PORT"));
}

jstring j_host = env->NewStringUTF(kEmulatorLocalHost);
env->CallVoidMethod(AuthImpl(auth_data),
auth::GetMethodId(auth::kUseEmulator), j_host, port);
env->DeleteLocalRef(j_host);
firebase::util::CheckAndClearJniExceptions(env);
SetEmulatorJni(auth_data, kEmulatorLocalHost, port);
}

// Release cached Java classes.
Expand Down Expand Up @@ -828,6 +831,10 @@ Future<void> Auth::SendPasswordResetEmail(const char* email) {
return MakeFuture(&futures, handle);
}

void Auth::UseEmulator(std::string host, uint32_t port) {
SetEmulatorJni(auth_data_, host.c_str(), port);
}

// Not implemented for Android.
void EnableTokenAutoRefresh(AuthData* auth_data) {}
void DisableTokenAutoRefresh(AuthData* auth_data) {}
Expand Down
8 changes: 8 additions & 0 deletions auth/src/desktop/auth_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,14 @@ void Auth::UseAppLanguage() {
auth_impl->language_code.assign(empty_string);
}

void Auth::UseEmulator(std::string host, uint32_t port) {
auto auth_impl = static_cast<AuthImpl*>(auth_data_->auth_impl);
auth_impl->assigned_emulator_url = "";
auth_impl->assigned_emulator_url.append(host);
auth_impl->assigned_emulator_url.append(":");
auth_impl->assigned_emulator_url.append(std::to_string(port));
}

void InitializeTokenRefresher(AuthData* auth_data) {
auto auth_impl = static_cast<AuthImpl*>(auth_data->auth_impl);
auth_impl->token_refresh_thread.Initialize(auth_data);
Expand Down
2 changes: 2 additions & 0 deletions auth/src/desktop/auth_desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ struct AuthImpl {
// The current user language code. This can be set to the app’s current
// language by calling SetLanguageCode.
std::string language_code;

std::string assigned_emulator_url;
};

// Constant, describing how often we automatically fetch a new auth token.
Expand Down
Loading