Skip to content

Commit f938d67

Browse files
authored
Move UMP SDK to a top-level directory. (#1712)
* Start copying over the files. * Move all the source files. * Rename and refactor all of the source files and namespaces. * Update integration test. * Update build script. * Remove a few other mentions of GMA here. * Update readme. * Update testapp configurator. * Update Android dependencies. * Some few lingering changes needed. * Typo. * Format code. * Add deprecation flags. * Fix typo. * Fix deprecation comments. * Remove GMA-specific integration test setup. * Remove leftover GMA references. * Fix build error. * Add missing static memory allocation. * Add resources for UMP tests. * Remove extraneous include. * Add application ID back. * Add missing static memory allocations. * Format code. * Add deprecation note. * Add verbose flag. * Add missing library to packaged SDK cmake file.
1 parent 204a873 commit f938d67

Some content is hidden

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

58 files changed

+5410
-29
lines changed

.github/workflows/integration_tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
required: true
1818
apis:
1919
description: 'CSV of apis to build and test'
20-
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage'
20+
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage,ump'
2121
required: true
2222
operating_systems:
2323
description: 'CSV of VMs to run on'
@@ -192,7 +192,7 @@ jobs:
192192
# list. Then we can use fromJson to define the field in the matrix for the tests job.
193193
if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
194194
# at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
195-
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
195+
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage,ump"
196196
echo "::warning ::Running main nightly tests"
197197
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
198198
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
@@ -353,7 +353,7 @@ jobs:
353353
elif [[ "${{ github.event.inputs.firestore_dep_source }}" ]]; then
354354
additional_flags+=(--cmake_flag=-DFIRESTORE_DEP_SOURCE=${{ github.event.inputs.firestore_dep_source }})
355355
fi
356-
python scripts/gha/build_testapps.py --p Desktop \
356+
VERBOSE=1 python scripts/gha/build_testapps.py --p Desktop \
357357
--t ${{ needs.check_and_prepare.outputs.apis }} \
358358
--output_directory "${{ github.workspace }}" \
359359
--artifact_name "desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}" \

Android/firebase_dependencies.gradle

+7-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def firebaseDependenciesMap = [
3939
'performance' : ['com.google.firebase:firebase-perf'],
4040
'remote_config' : ['com.google.firebase:firebase-config'],
4141
'storage' : ['com.google.firebase:firebase-storage'],
42-
'testlab' : []
42+
'testlab' : [],
43+
'ump' : ['com.google.android.ump:user-messaging-platform:2.2.0']
4344
]
4445

4546
// A map of library to the gradle resources that they depend upon.
@@ -53,7 +54,8 @@ def firebaseResourceDependenciesMap = [
5354
'firestore' : [':firestore:firestore_resources'],
5455
'gma' : [':gma:gma_resources'],
5556
'remote_config' : [':remote_config:remote_config_resources'],
56-
'storage' : [':storage:storage_resources']
57+
'storage' : [':storage:storage_resources'],
58+
'ump' : [':ump:ump_resources']
5759
]
5860

5961
def setResourceDependencies(String subproject) {
@@ -116,6 +118,9 @@ class Dependencies {
116118
def getStorage() {
117119
libSet.add('storage')
118120
}
121+
def getUmp() {
122+
libSet.add('ump')
123+
}
119124
}
120125

121126
// Extension to handle which Firebase C++ dependencies are being added to the

CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ option(FIREBASE_INCLUDE_FUNCTIONS
5050
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5151
option(FIREBASE_INCLUDE_GMA "Include the GMA library."
5252
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
53+
option(FIREBASE_INCLUDE_UMP "Include the UMP library."
54+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5355
option(FIREBASE_INCLUDE_INSTALLATIONS
5456
"Include the Firebase Installations library."
5557
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
@@ -123,9 +125,10 @@ if(FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS)
123125
endif()
124126

125127
if (PLATFORM STREQUAL TVOS OR PLATFORM STREQUAL SIMULATOR_TVOS)
126-
# GMA and FDL are not supported on tvOS.
128+
# GMA, UMP, and FDL are not supported on tvOS.
127129
set(FIREBASE_INCLUDE_DYNAMIC_LINKS OFF)
128130
set(FIREBASE_INCLUDE_GMA OFF)
131+
set(FIREBASE_INCLUDE_UMP OFF)
129132
endif()
130133

131134
# Occasionally ANDROID is not being set correctly when invoked by gradle, so
@@ -630,6 +633,9 @@ endif()
630633
if (FIREBASE_INCLUDE_GMA)
631634
add_subdirectory(gma)
632635
endif()
636+
if (FIREBASE_INCLUDE_UMP)
637+
add_subdirectory(ump)
638+
endif()
633639
if (FIREBASE_INCLUDE_INSTALLATIONS)
634640
add_subdirectory(installations)
635641
endif()

app/CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ if (IOS)
566566
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/listener.h
567567
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/metadata.h
568568
${FIREBASE_SOURCE_DIR}/storage/src/include/firebase/storage/storage_reference.h)
569+
set(ump_HDRS
570+
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump.h
571+
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump/consent_info.h
572+
${FIREBASE_SOURCE_DIR}/ump/src/include/firebase/ump/types.h)
569573

570574
list(APPEND framework_HDRS
571575
src/include/firebase/internal/platform.h
@@ -580,7 +584,9 @@ if (IOS)
580584
${installations_HDRS}
581585
${messaging_HDRS}
582586
${remote_config_HDRS}
583-
${storage_HDRS})
587+
${storage_HDRS}
588+
${ump_HDRS}
589+
)
584590

585591
# add framework header files to target
586592
target_sources(firebase_app PRIVATE ${framework_HDRS})

build_scripts/ios/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ readonly SUPPORTED_PLATFORMS=(device simulator)
2727
readonly SUPPORTED_ARCHITECTURES=(arm64 x86_64)
2828
readonly DEVICE_ARCHITECTURES=(arm64)
2929
readonly SIMULATOR_ARCHITECTURES=(arm64 x86_64)
30-
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)
30+
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)
3131

3232
# build default value
3333
buildpath="ios_build"

build_scripts/packaging.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# List of all Firebase products to include in the binary SDK package.
44
readonly -a product_list=(analytics app app_check auth database
55
dynamic_links firestore functions gma installations messaging
6-
remote_config storage)
6+
remote_config storage ump)

gma/src/include/firebase/gma/ump/consent_info.h

+59
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "firebase/app.h"
2121
#include "firebase/future.h"
2222
#include "firebase/gma/ump/types.h"
23+
#include "firebase/internal/common.h"
2324
#include "firebase/internal/platform.h"
2425

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

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

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

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

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

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

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

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

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

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

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

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

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

185226
/// Get the Future from the most recent call to
186227
/// LoadAndShowConsentFormIfRequired().
228+
///
229+
/// @deprecated This class has been moved to the firebase::ump namespace.
230+
FIREBASE_DEPRECATED
187231
Future<void> LoadAndShowConsentFormIfRequiredLastResult();
188232

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

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

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

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

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

224283
private:

gma/src/include/firebase/gma/ump/types.h

+17
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <utility>
2222
#include <vector>
2323

24+
#include "firebase/internal/common.h"
2425
#include "firebase/internal/platform.h"
2526

2627
#if FIREBASE_PLATFORM_ANDROID
@@ -37,6 +38,8 @@ namespace gma {
3738
namespace ump {
3839

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

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

@@ -92,6 +99,8 @@ typedef void* FormParent;
9299
// FIREBASE_PLATFORM_TVOS
93100

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

106115
/// Errors that can occur during a RequestConsentInfoUpdate operation.
116+
///
117+
/// @deprecated This enum has been moved to the firebase::ump namespace.
107118
enum ConsentRequestError {
108119
/// The operation succeeded.
109120
kConsentRequestSuccess = 0,
@@ -126,6 +137,8 @@ enum ConsentRequestError {
126137
};
127138

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

141154
/// Errors when loading or showing the consent form.
155+
///
156+
/// @deprecated This enum has been moved to the firebase::ump namespace.
142157
enum ConsentFormError {
143158
/// The operation succeeded.
144159
kConsentFormSuccess = 0,
@@ -161,6 +176,8 @@ enum ConsentFormError {
161176
};
162177

163178
/// Whether the privacy options need to be displayed.
179+
///
180+
/// @deprecated This enum has been moved to the firebase::ump namespace.
164181
enum PrivacyOptionsRequirementStatus {
165182
/// Privacy options requirement status is unknown. Call
166183
/// `ConsentInfo::RequestConsentInfoUpdate()` to update.

0 commit comments

Comments
 (0)