Skip to content

Commit 2e89f4c

Browse files
committed
Removed SetCurrentScreen method.
Syncing with the removal from underlying native mobile SDKs.
1 parent e7d6977 commit 2e89f4c

File tree

8 files changed

+2
-72
lines changed

8 files changed

+2
-72
lines changed

analytics/integration_test/src/integration_test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ TEST_F(FirebaseAnalyticsTest, TestSetProperties) {
9999
firebase::analytics::kUserPropertySignUpMethod, "Google");
100100
// Set the user ID.
101101
firebase::analytics::SetUserId("my_integration_test_user");
102-
103-
firebase::analytics::SetCurrentScreen(
104-
"Firebase Analytics C++ integration test", "integration_test");
105102
}
106103

107104
TEST_F(FirebaseAnalyticsTest, TestLogEvents) {

analytics/src/analytics_android.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,6 @@ static void SetCurrentScreenReal(void* raw_data) {
357357
delete data;
358358
}
359359

360-
void SetCurrentScreen(const char* screen_name, const char* screen_class) {
361-
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
362-
// Run SetCurrentScreen on the main thread.
363-
SetCurrentScreenData* data =
364-
new SetCurrentScreenData(screen_name, screen_class);
365-
// The callback will delete `data`.
366-
util::RunOnMainThread(g_app->GetJNIEnv(), g_app->activity(),
367-
SetCurrentScreenReal, data);
368-
}
369-
370360
void ResetAnalyticsData() {
371361
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
372362
JNIEnv* env = g_app->GetJNIEnv();

analytics/src/analytics_ios.mm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,6 @@ void SetSessionTimeoutDuration(int64_t milliseconds) {
243243
setSessionTimeoutInterval:static_cast<NSTimeInterval>(milliseconds) / kMillisecondsPerSecond];
244244
}
245245

246-
void SetCurrentScreen(const char* screen_name, const char* screen_class) {
247-
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
248-
[FIRAnalytics setScreenName:screen_name ? @(screen_name) : nil
249-
screenClass:screen_class ? @(screen_class) : nil];
250-
}
251-
252246
void ResetAnalyticsData() {
253247
MutexLock lock(g_mutex);
254248
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());

analytics/src/analytics_stub.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ void SetSessionTimeoutDuration(int64_t /*milliseconds*/) {
109109
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
110110
}
111111

112-
void SetCurrentScreen(const char* /*screen_name*/,
113-
const char* /*screen_class*/) {
114-
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
115-
}
116-
117112
void ResetAnalyticsData() {
118113
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
119114
g_fake_instance_id++;

analytics/src/include/firebase/analytics.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -497,18 +497,6 @@ void SetUserId(const char* user_id);
497497
/// session.
498498
void SetSessionTimeoutDuration(int64_t milliseconds);
499499

500-
/// @brief Sets the current screen name and screen class, which specifies the
501-
/// current visual context in your app. This helps identify the areas in your
502-
/// app where users spend their time and how they interact with your app.
503-
///
504-
/// @param screen_name The name of the current screen. Set to nullptr to clear
505-
/// the current screen name. Limited to 100 characters.
506-
/// @param screen_class The name of the screen class. If you specify nullptr for
507-
/// this, it will use the default. On Android, the default is the class name of
508-
/// the current Activity. On iOS, the default is the class name of the current
509-
/// UIViewController. Limited to 100 characters.
510-
void SetCurrentScreen(const char* screen_name, const char* screen_class);
511-
512500
/// Clears all analytics data for this app from the device and resets the app
513501
/// instance id.
514502
void ResetAnalyticsData();

analytics/src_java/fake/com/google/firebase/analytics/FirebaseAnalytics.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ public void setUserProperty(String name, String value) {
6868
FakeReporter.addReport("FirebaseAnalytics.setUserProperty", name, String.valueOf(value));
6969
}
7070

71-
public void setCurrentScreen(Activity activity, String screenName,
72-
String screenClassOverride) {
73-
FakeReporter.addReport("FirebaseAnalytics.setCurrentScreen", activity.getClass().getName(),
74-
String.valueOf(screenName), String.valueOf(screenClassOverride));
75-
}
76-
7771
public void setUserId(String userId) {
7872
FakeReporter.addReport("FirebaseAnalytics.setUserId", String.valueOf(userId));
7973
}

analytics/tests/analytics_test.cc

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -259,36 +259,6 @@ TEST_F(AnalyticsTest, TestSetSessionTimeoutDuration) {
259259
SetSessionTimeoutDuration(1000);
260260
}
261261

262-
TEST_F(AnalyticsTest, TestSetCurrentScreen) {
263-
AddExpectationAndroid("FirebaseAnalytics.setCurrentScreen",
264-
{"android.app.Activity", "my_screen", "my_class"});
265-
AddExpectationApple("+[FIRAnalytics setScreenName:screenClass:]",
266-
{"my_screen", "my_class"});
267-
268-
SetCurrentScreen("my_screen", "my_class");
269-
WaitForMainThreadTask();
270-
}
271-
272-
TEST_F(AnalyticsTest, TestSetCurrentScreenNullScreen) {
273-
AddExpectationAndroid("FirebaseAnalytics.setCurrentScreen",
274-
{"android.app.Activity", "null", "my_class"});
275-
AddExpectationApple("+[FIRAnalytics setScreenName:screenClass:]",
276-
{"nil", "my_class"});
277-
278-
SetCurrentScreen(nullptr, "my_class");
279-
WaitForMainThreadTask();
280-
}
281-
282-
TEST_F(AnalyticsTest, TestSetCurrentScreenNullClass) {
283-
AddExpectationAndroid("FirebaseAnalytics.setCurrentScreen",
284-
{"android.app.Activity", "my_screen", "null"});
285-
AddExpectationApple("+[FIRAnalytics setScreenName:screenClass:]",
286-
{"my_screen", "nil"});
287-
288-
SetCurrentScreen("my_screen", nullptr);
289-
WaitForMainThreadTask();
290-
}
291-
292262
TEST_F(AnalyticsTest, TestResetAnalyticsData) {
293263
AddExpectationAndroid("FirebaseAnalytics.resetAnalyticsData", {});
294264
AddExpectationApple("+[FIRAnalytics resetAnalyticsData]", {});

release_build_files/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ code.
365365
### 8.0.0
366366

367367
- Changes
368+
- Analytics: Removed `SetCurrentScreen()` following the removal from underlying
369+
native SDKs.
368370
- Instance Id: Removed support for the previously-deprecated Instance ID SDK.
369371
- Remote Config: The previously-deprecated static methods have been removed.
370372
Please use the new instance-based `firebase::remote_config::RemoteConfig`

0 commit comments

Comments
 (0)