Skip to content

Commit 2f73e9a

Browse files
committed
Add deprecation flags.
1 parent 7d63e3b commit 2f73e9a

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

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

Lines changed: 56 additions & 0 deletions
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
@@ -49,6 +50,8 @@ class ConsentInfoInternal;
4950
///
5051
/// This class contains all of the methods necessary for obtaining
5152
/// consent from the user.
53+
///
54+
/// @deprecated This class has been moved to the firebase::ump namespace.
5255
class ConsentInfo {
5356
public:
5457
/// Shut down the User Messaging Platform Consent SDK.
@@ -67,6 +70,9 @@ class ConsentInfo {
6770
/// initialized, nullptr otherwise. Each call to GetInstance() will return the
6871
/// same pointer; when you are finished using the SDK, you can delete the
6972
/// pointer and the UMP SDK will shut down.
73+
///
74+
/// @deprecated This class has been moved to the firebase::ump namespace.
75+
FIREBASE_DEPRECATED
7076
static ConsentInfo* GetInstance(const ::firebase::App& app,
7177
InitResult* init_result_out = nullptr);
7278

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

@@ -104,6 +111,7 @@ class ConsentInfo {
104111
// existing ConsentInfo instance after it's first initialized. Returns nullptr
105112
// if no instance has been created yet; make sure you have called
106113
// GetInstance(JNIEnv*, jobject) first.
114+
FIREBASE_DEPRECATED
107115
static ConsentInfo* GetInstance();
108116
#endif // defined(DOXYGEN)
109117
#endif // FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN)
@@ -123,12 +131,18 @@ class ConsentInfo {
123131
///
124132
/// @note Once any overload of ConsentInfo::GetInstance has been called, you
125133
/// 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
126137
static ConsentInfo* GetInstance(InitResult* init_result_out = nullptr);
127138
#endif // !defined(__ANDROID__) || defined(DOXYGEN)
128139

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

134148
/// Requests consent information update. Must be called in every app session
@@ -137,20 +151,35 @@ class ConsentInfo {
137151
/// updated immediately to hold the consent state from the previous app
138152
/// session, if one exists. GetConsentStatus() and CanRequestAds() may be
139153
/// 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
140157
Future<void> RequestConsentInfoUpdate(const ConsentRequestParameters& params);
141158

142159
/// 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
143163
Future<void> RequestConsentInfoUpdateLastResult();
144164

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

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

153179
/// 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
154183
Future<void> LoadConsentFormLastResult();
155184

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

171203
/// 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
172207
Future<void> ShowConsentFormLastResult();
173208

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

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

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

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

214261
/// 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
215265
Future<void> ShowPrivacyOptionsFormLastResult();
216266

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

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

227283
private:

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <vector>
2323

2424
#include "firebase/internal/platform.h"
25+
#include "firebase/internal/common.h"
2526

2627
#if FIREBASE_PLATFORM_ANDROID
2728
#include <jni.h>
@@ -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 struct 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 struct 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 struct 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 struct 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 struct 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)