Skip to content

Move UMP SDK to a top-level directory. #1712

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
merged 27 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
39cc616
Start copying over the files.
jonsimantov May 8, 2025
90ec0e1
Move all the source files.
jonsimantov May 8, 2025
7ca910f
Rename and refactor all of the source files and namespaces.
jonsimantov May 8, 2025
c721650
Update integration test.
jonsimantov May 8, 2025
bcc01f6
Update build script.
jonsimantov May 8, 2025
48cbbe3
Remove a few other mentions of GMA here.
jonsimantov May 8, 2025
39996db
Update readme.
jonsimantov May 8, 2025
96999c9
Update testapp configurator.
jonsimantov May 8, 2025
ffc3d0e
Update Android dependencies.
jonsimantov May 8, 2025
d144700
Some few lingering changes needed.
jonsimantov May 8, 2025
cae8512
Typo.
jonsimantov May 8, 2025
7d63e3b
Format code.
jonsimantov May 8, 2025
2f73e9a
Add deprecation flags.
jonsimantov May 8, 2025
ea2a03e
Fix typo.
jonsimantov May 8, 2025
c03808d
Fix deprecation comments.
jonsimantov May 12, 2025
26bbc9f
Remove GMA-specific integration test setup.
jonsimantov May 12, 2025
be00b19
Remove leftover GMA references.
jonsimantov May 12, 2025
c96d5c2
Fix build error.
jonsimantov May 12, 2025
e6d05ab
Add missing static memory allocation.
jonsimantov May 12, 2025
193e428
Add resources for UMP tests.
jonsimantov May 13, 2025
0c4bf66
Remove extraneous include.
jonsimantov May 13, 2025
c9529b1
Add application ID back.
jonsimantov May 13, 2025
977d3ab
Add missing static memory allocations.
jonsimantov May 14, 2025
89ed214
Format code.
jonsimantov May 14, 2025
b365933
Add deprecation note.
jonsimantov May 14, 2025
ba503a2
Add verbose flag.
jonsimantov May 15, 2025
ab43a27
Add missing library to packaged SDK cmake file.
jonsimantov May 15, 2025
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 .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
required: true
apis:
description: 'CSV of apis to build and test'
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage'
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage,ump'
required: true
operating_systems:
description: 'CSV of VMs to run on'
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
# list. Then we can use fromJson to define the field in the matrix for the tests job.
if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
# at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage,ump"
echo "::warning ::Running main nightly tests"
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
Expand Down
9 changes: 7 additions & 2 deletions Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def firebaseDependenciesMap = [
'performance' : ['com.google.firebase:firebase-perf'],
'remote_config' : ['com.google.firebase:firebase-config'],
'storage' : ['com.google.firebase:firebase-storage'],
'testlab' : []
'testlab' : [],
'ump' : ['com.google.android.ump:user-messaging-platform:2.2.0']
]

// A map of library to the gradle resources that they depend upon.
Expand All @@ -53,7 +54,8 @@ def firebaseResourceDependenciesMap = [
'firestore' : [':firestore:firestore_resources'],
'gma' : [':gma:gma_resources'],
'remote_config' : [':remote_config:remote_config_resources'],
'storage' : [':storage:storage_resources']
'storage' : [':storage:storage_resources'],
'ump' : [':ump:ump_resources']
]

def setResourceDependencies(String subproject) {
Expand Down Expand Up @@ -116,6 +118,9 @@ class Dependencies {
def getStorage() {
libSet.add('storage')
}
def getUmp() {
libSet.add('ump')
}
}

// Extension to handle which Firebase C++ dependencies are being added to the
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ option(FIREBASE_INCLUDE_FUNCTIONS
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
option(FIREBASE_INCLUDE_GMA "Include the GMA library."
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
option(FIREBASE_INCLUDE_UMP "Include the UMP library."
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
option(FIREBASE_INCLUDE_INSTALLATIONS
"Include the Firebase Installations library."
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
Expand Down Expand Up @@ -123,9 +125,10 @@ if(FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS)
endif()

if (PLATFORM STREQUAL TVOS OR PLATFORM STREQUAL SIMULATOR_TVOS)
# GMA and FDL are not supported on tvOS.
# GMA, UMP, and FDL are not supported on tvOS.
set(FIREBASE_INCLUDE_DYNAMIC_LINKS OFF)
set(FIREBASE_INCLUDE_GMA OFF)
set(FIREBASE_INCLUDE_UMP OFF)
endif()

# Occasionally ANDROID is not being set correctly when invoked by gradle, so
Expand Down Expand Up @@ -630,6 +633,9 @@ endif()
if (FIREBASE_INCLUDE_GMA)
add_subdirectory(gma)
endif()
if (FIREBASE_INCLUDE_UMP)
add_subdirectory(ump)
endif()
if (FIREBASE_INCLUDE_INSTALLATIONS)
add_subdirectory(installations)
endif()
Expand Down
8 changes: 7 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ if (IOS)
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/listener.h
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/metadata.h
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/storage_reference.h)
set(ump_HDRS
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump.h
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump/consent_info.h
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump/types.h)

list(APPEND framework_HDRS
src/include/firebase/internal/platform.h
Expand All @@ -580,7 +584,9 @@ if (IOS)
${installations_HDRS}
${messaging_HDRS}
${remote_config_HDRS}
${storage_HDRS})
${storage_HDRS}
${ump_HDRS}
)

# add framework header files to target
target_sources(firebase_app PRIVATE ${framework_HDRS})
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ readonly SUPPORTED_PLATFORMS=(device simulator)
readonly SUPPORTED_ARCHITECTURES=(arm64 x86_64)
readonly DEVICE_ARCHITECTURES=(arm64)
readonly SIMULATOR_ARCHITECTURES=(arm64 x86_64)
readonly SUPPORTED_TARGETS=(firebase_analytics firebase_auth firebase_app_check firebase_database firebase_dynamic_links firebase_firestore firebase_functions firebase_gma firebase_installations firebase_messaging firebase_remote_config firebase_storage)
readonly SUPPORTED_TARGETS=(firebase_analytics firebase_auth firebase_app_check firebase_database firebase_dynamic_links firebase_firestore firebase_functions firebase_gma firebase_installations firebase_messaging firebase_remote_config firebase_storage firebase_ump)

# build default value
buildpath="ios_build"
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/packaging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# List of all Firebase products to include in the binary SDK package.
readonly -a product_list=(analytics app app_check auth database
dynamic_links firestore functions gma installations messaging
remote_config storage)
remote_config storage ump)
59 changes: 59 additions & 0 deletions gma/src/include/firebase/gma/ump/consent_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "firebase/app.h"
#include "firebase/future.h"
#include "firebase/gma/ump/types.h"
#include "firebase/internal/common.h"
#include "firebase/internal/platform.h"

#if FIREBASE_PLATFORM_ANDROID
Expand All @@ -32,6 +33,9 @@ namespace gma {
///
/// The User Messaging Platform (UMP) SDK is Google’s option to handle user
/// privacy and consent in mobile apps.
///
/// @deprecated The firebase::gma::ump namespace has been deprecated and
/// renamed to firebase::ump.
namespace ump {

namespace internal {
Expand All @@ -46,6 +50,8 @@ class ConsentInfoInternal;
///
/// This class contains all of the methods necessary for obtaining
/// consent from the user.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
class ConsentInfo {
public:
/// Shut down the User Messaging Platform Consent SDK.
Expand All @@ -64,6 +70,9 @@ class ConsentInfo {
/// initialized, nullptr otherwise. Each call to GetInstance() will return the
/// same pointer; when you are finished using the SDK, you can delete the
/// pointer and the UMP SDK will shut down.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
static ConsentInfo* GetInstance(const ::firebase::App& app,
InitResult* init_result_out = nullptr);

Expand Down Expand Up @@ -93,6 +102,7 @@ class ConsentInfo {
/// initialized, nullptr otherwise. Each call to GetInstance() will return the
/// same pointer; when you are finished using the SDK, you can delete the
/// pointer and the UMP SDK will shut down.
FIREBASE_DEPRECATED
static ConsentInfo* GetInstance(JNIEnv* jni_env, jobject activity,
InitResult* init_result_out = nullptr);

Expand All @@ -101,6 +111,7 @@ class ConsentInfo {
// existing ConsentInfo instance after it's first initialized. Returns nullptr
// if no instance has been created yet; make sure you have called
// GetInstance(JNIEnv*, jobject) first.
FIREBASE_DEPRECATED
static ConsentInfo* GetInstance();
#endif // defined(DOXYGEN)
#endif // FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN)
Expand All @@ -120,12 +131,18 @@ class ConsentInfo {
///
/// @note Once any overload of ConsentInfo::GetInstance has been called, you
/// can use this method to obtain the same instance again.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
static ConsentInfo* GetInstance(InitResult* init_result_out = nullptr);
#endif // !defined(__ANDROID__) || defined(DOXYGEN)

/// The user’s consent status. This value defaults to kConsentStatusUnknown
/// until RequestConsentInfoUpdate() is called, and defaults to the previous
/// session’s value until RequestConsentInfoUpdate() completes.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
ConsentStatus GetConsentStatus();

/// Requests consent information update. Must be called in every app session
Expand All @@ -134,20 +151,35 @@ class ConsentInfo {
/// updated immediately to hold the consent state from the previous app
/// session, if one exists. GetConsentStatus() and CanRequestAds() may be
/// updated again immediately before the returned future is completed.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> RequestConsentInfoUpdate(const ConsentRequestParameters& params);

/// Get the Future from the most recent call to RequestConsentInfoUpdate().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> RequestConsentInfoUpdateLastResult();

/// Consent form status. This value defaults to kConsentFormStatusUnknown and
/// requires a call to RequestConsentInfoUpdate() to update.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
ConsentFormStatus GetConsentFormStatus();

/// Loads a consent form. Returns an error if the consent form is unavailable
/// or cannot be loaded.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> LoadConsentForm();

/// Get the Future from the most recent call to LoadConsentForm().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> LoadConsentFormLastResult();

/// Presents the full screen consent form using the given FormParent, which is
Expand All @@ -163,9 +195,15 @@ class ConsentInfo {
///
/// @note You must call LoadConsentForm() and wait for it to complete before
/// calling this method.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> ShowConsentForm(FormParent parent);

/// Get the Future from the most recent call to ShowConsentForm().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> ShowConsentFormLastResult();

/// Loads a consent form and immediately presents it using the given
Expand All @@ -180,14 +218,23 @@ class ConsentInfo {
///
/// @param[in] parent A FormParent, which is an Activity object on Android and
/// a UIViewController object on iOS.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> LoadAndShowConsentFormIfRequired(FormParent parent);

/// Get the Future from the most recent call to
/// LoadAndShowConsentFormIfRequired().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> LoadAndShowConsentFormIfRequiredLastResult();

/// Check whether the privacy options form needs to be displayed.
/// This is updated by RequestConsentInfoUpdate().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus();

/// If GetPrivacyOptionsRequirementStatus() is
Expand All @@ -206,19 +253,31 @@ class ConsentInfo {
///
/// @param[in] parent A FormParent, which is an Activity object on Android and
/// a UIViewController object on iOS.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> ShowPrivacyOptionsForm(FormParent parent);

/// Get the Future from the most recent call to ShowPrivacyOptionsForm().
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
Future<void> ShowPrivacyOptionsFormLastResult();

/// Indicates whether the app has completed the necessary steps for gathering
/// updated user consent. Returns true if RequestConsentInfoUpdate() has been
/// called and GetConsentStatus returns either kConsentStatusNotRequired or
/// kConsentStatusObtained.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
bool CanRequestAds();

/// Clears all consent state from persistent storage. This can be used in
/// development to simulate a new installation.
///
/// @deprecated This class has been moved to the firebase::ump namespace.
FIREBASE_DEPRECATED
void Reset();

private:
Expand Down
17 changes: 17 additions & 0 deletions gma/src/include/firebase/gma/ump/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <utility>
#include <vector>

#include "firebase/internal/common.h"
#include "firebase/internal/platform.h"

#if FIREBASE_PLATFORM_ANDROID
Expand All @@ -37,6 +38,8 @@ namespace gma {
namespace ump {

/// Debug values for testing geography.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum ConsentDebugGeography {
/// Disable geography debugging.
kConsentDebugGeographyDisabled = 0,
Expand All @@ -49,6 +52,8 @@ enum ConsentDebugGeography {
/// Debug settings for `ConsentInfo::RequestConsentInfoUpdate()`. These let you
/// force a specific geographic location. Be sure to include debug device IDs to
/// enable this on hardware. Debug features are always enabled for simulators.
///
/// @deprecated This struct has been moved to the firebase::ump namespace.
struct ConsentDebugSettings {
/// Create a default debug setting, with debugging disabled.
ConsentDebugSettings() : debug_geography(kConsentDebugGeographyDisabled) {}
Expand All @@ -61,6 +66,8 @@ struct ConsentDebugSettings {
};

/// Parameters for the `ConsentInfo::RequestConsentInfoUpdate()` operation.
///
/// @deprecated This struct has been moved to the firebase::ump namespace.
struct ConsentRequestParameters {
ConsentRequestParameters() : tag_for_under_age_of_consent(false) {}

Expand Down Expand Up @@ -92,6 +99,8 @@ typedef void* FormParent;
// FIREBASE_PLATFORM_TVOS

/// Consent status values.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum ConsentStatus {
/// Unknown status, e.g. prior to calling Request, or if the request fails.
kConsentStatusUnknown = 0,
Expand All @@ -104,6 +113,8 @@ enum ConsentStatus {
};

/// Errors that can occur during a RequestConsentInfoUpdate operation.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum ConsentRequestError {
/// The operation succeeded.
kConsentRequestSuccess = 0,
Expand All @@ -126,6 +137,8 @@ enum ConsentRequestError {
};

/// Status of the consent form, whether it is available to show or not.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum ConsentFormStatus {
/// Status is unknown. Call `ConsentInfo::RequestConsentInfoUpdate()` to
/// update this.
Expand All @@ -139,6 +152,8 @@ enum ConsentFormStatus {
};

/// Errors when loading or showing the consent form.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum ConsentFormError {
/// The operation succeeded.
kConsentFormSuccess = 0,
Expand All @@ -161,6 +176,8 @@ enum ConsentFormError {
};

/// Whether the privacy options need to be displayed.
///
/// @deprecated This enum has been moved to the firebase::ump namespace.
enum PrivacyOptionsRequirementStatus {
/// Privacy options requirement status is unknown. Call
/// `ConsentInfo::RequestConsentInfoUpdate()` to update.
Expand Down
6 changes: 5 additions & 1 deletion release_build_files/Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def firebaseDependenciesMap = [
'performance' : ['com.google.firebase:firebase-perf'],
'remote_config' : ['com.google.firebase:firebase-config'],
'storage' : ['com.google.firebase:firebase-storage'],
'testlab' : []
'testlab' : [],
'ump' : ['com.google.android.ump:user-messaging-platform:2.2.0']
]

// Handles adding the Firebase C++ dependencies as properties.
Expand Down Expand Up @@ -98,6 +99,9 @@ class Dependencies {
def getTestlab() {
libSet.add('testlab')
}
def getUmp() {
libSet.add('ump')
}
}

// Extension to handle which Firebase C++ dependencies are being added to the
Expand Down
Loading
Loading