From 59eb17719a4d5e9d01c4b10ff0188107d6780a69 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 11 Nov 2024 14:06:31 +0300 Subject: [PATCH 01/32] feat: remove visibility from the end view --- CHANGELOG.md | 3 +++ .../ly/count/android/sdk/ModuleEvents.java | 20 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 561960946..cff63f204 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## XX.XX.XX +* Visibility tracking for end view requests has been removed to improve functionality. + ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. diff --git a/sdk/src/main/java/ly/count/android/sdk/ModuleEvents.java b/sdk/src/main/java/ly/count/android/sdk/ModuleEvents.java index 4e0857817..0261b1761 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ModuleEvents.java +++ b/sdk/src/main/java/ly/count/android/sdk/ModuleEvents.java @@ -156,18 +156,22 @@ public void recordEventInternal(@Nullable final String key, @Nullable Map(); } - segmentation.put(VISIBILITY_KEY, state); + if (ModuleViews.VIEW_EVENT_KEY.equals(key) && !segmentation.containsKey("visit")) { + L.d("[ModuleEvents] recordEventInternal, visibility key will not be added to the end view event"); + } else { + String appInBackground = deviceInfo.isInBackground(); + int state = 1; // in foreground + if ("true".equals(appInBackground)) { + state = 0; // in background + } + L.d("[ModuleEvents] recordEventInternal, Adding visibility tracking to segmentation app in background:[" + appInBackground + "] cly_v:[" + state + "]"); + + segmentation.put(VISIBILITY_KEY, state); + } } switch (key) { From fdcec88505ea30a7800a47e61c5273988464d009 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 11 Nov 2024 14:08:36 +0300 Subject: [PATCH 02/32] fix: tests --- .../java/ly/count/android/sdk/ModuleEventsTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java b/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java index e2ef6602a..5dc755d56 100644 --- a/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java +++ b/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java @@ -834,7 +834,7 @@ public void recordEvent_visibilityTracking_bgFgSwitch() throws JSONException { countly.onStart(Mockito.mock(Activity.class)); //foreground - countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map()); + countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 1), 1, 0.0d, 0.0d, 2); countly.events().recordEvent("fg", TestUtils.map()); @@ -842,7 +842,7 @@ public void recordEvent_visibilityTracking_bgFgSwitch() throws JSONException { countly.onStop(); //background - countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map()); + countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 0), 1, 0.0d, 0.0d, 5); countly.events().recordEvent("bg", TestUtils.map()); @@ -864,7 +864,7 @@ public void recordEvent_visibilityTracking_notEnabled() throws JSONException { countly.onStart(Mockito.mock(Activity.class)); //foreground - countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map()); + countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 2); countly.events().recordEvent("fg", TestUtils.map()); @@ -872,7 +872,7 @@ public void recordEvent_visibilityTracking_notEnabled() throws JSONException { countly.onStop(); //background - countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map()); + countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 5); countly.events().recordEvent("bg", TestUtils.map()); From f25c264e84ac913c1600ce8ce68e7e3c5fa3e615 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 11 Nov 2024 14:09:46 +0300 Subject: [PATCH 03/32] fix: tests --- .../java/ly/count/android/sdk/ModuleEventsTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java b/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java index 5dc755d56..0cd842301 100644 --- a/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java +++ b/sdk/src/androidTest/java/ly/count/android/sdk/ModuleEventsTests.java @@ -807,8 +807,8 @@ public void recordEvent_visibilityTracking_onlyAddingItToViewsAndEvents() throws countly.events().recordEvent(ModuleFeedback.RATING_EVENT_KEY, TestUtils.map()); validateEventInRQ(ModuleFeedback.RATING_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 4); - countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map()); - validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 0), 1, 0.0d, 0.0d, 5); + countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); + validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 0, "visit", 1), 1, 0.0d, 0.0d, 5); countly.events().recordEvent(ModuleViews.ORIENTATION_EVENT_KEY, TestUtils.map()); validateEventInRQ(ModuleViews.ORIENTATION_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 6); @@ -835,7 +835,7 @@ public void recordEvent_visibilityTracking_bgFgSwitch() throws JSONException { countly.onStart(Mockito.mock(Activity.class)); //foreground countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); - validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 1), 1, 0.0d, 0.0d, 2); + validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 1, "visit", 1), 1, 0.0d, 0.0d, 2); countly.events().recordEvent("fg", TestUtils.map()); validateEventInRQ("fg", TestUtils.map("cly_v", 1), 1, 0.0d, 0.0d, 3); @@ -843,7 +843,7 @@ public void recordEvent_visibilityTracking_bgFgSwitch() throws JSONException { countly.onStop(); //background countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); - validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 0), 1, 0.0d, 0.0d, 5); + validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("cly_v", 0, "visit", 1), 1, 0.0d, 0.0d, 5); countly.events().recordEvent("bg", TestUtils.map()); validateEventInRQ("bg", TestUtils.map("cly_v", 0), 1, 0.0d, 0.0d, 6); @@ -865,7 +865,7 @@ public void recordEvent_visibilityTracking_notEnabled() throws JSONException { countly.onStart(Mockito.mock(Activity.class)); //foreground countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); - validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 2); + validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1), 1, 0.0d, 0.0d, 2); countly.events().recordEvent("fg", TestUtils.map()); validateEventInRQ("fg", TestUtils.map(), 1, 0.0d, 0.0d, 3); @@ -873,7 +873,7 @@ public void recordEvent_visibilityTracking_notEnabled() throws JSONException { countly.onStop(); //background countly.events().recordEvent(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1)); - validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map(), 1, 0.0d, 0.0d, 5); + validateEventInRQ(ModuleViews.VIEW_EVENT_KEY, TestUtils.map("visit", 1), 1, 0.0d, 0.0d, 5); countly.events().recordEvent("bg", TestUtils.map()); validateEventInRQ("bg", TestUtils.map(), 1, 0.0d, 0.0d, 6); From b30f415a713620da1efc74e682e8f757a70da9c0 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 11 Nov 2024 14:12:25 +0300 Subject: [PATCH 04/32] fix: mitigate --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cff63f204..e667560e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## XX.XX.XX -* Visibility tracking for end view requests has been removed to improve functionality. +* Mitigated an issue where visibility tracking for end view requests has been removed to improve functionality. ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. From ff1c2fb3f0ad18afe2d4897c33e102809cf06918 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray <57103426+arifBurakDemiray@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:33:53 +0300 Subject: [PATCH 05/32] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e667560e7..15d3114cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## XX.XX.XX -* Mitigated an issue where visibility tracking for end view requests has been removed to improve functionality. +* Mitigated an issue where sending visibility information with the end views too were creating improper results. (Experimental!) ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. From 020ebaeee9b6fb6f2c65968c171095d53dec9b7a Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:13:43 +0900 Subject: [PATCH 06/32] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15d3114cd..7eaa44fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## XX.XX.XX -* Mitigated an issue where sending visibility information with the end views too were creating improper results. (Experimental!) +* Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. From 5c84344d823b50d2bf2e78230d0df9c26bb4de91 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Sat, 16 Nov 2024 15:36:42 +0300 Subject: [PATCH 07/32] fix: global content callback --- CHANGELOG.md | 1 + sdk/src/main/java/ly/count/android/sdk/ModuleContent.java | 4 +++- .../main/java/ly/count/android/sdk/TransparentActivity.java | 5 +++-- .../java/ly/count/android/sdk/TransparentActivityConfig.java | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eaa44fff..6d7e79883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## XX.XX.XX * Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) +* Fixed a bug where passing the global content callback was not possible. ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. diff --git a/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java b/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java index ffbf7c673..8e0f49567 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java +++ b/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java @@ -162,7 +162,9 @@ private TransparentActivityConfig extractOrientationPlacements(@NonNull JSONObje TransparentActivityConfig config = new TransparentActivityConfig((int) Math.ceil(x * density), (int) Math.ceil(y * density), (int) Math.ceil(w * density), (int) Math.ceil(h * density)); config.url = content; - config.globalContentCallback = globalContentCallback; + // TODO, passing callback with an intent is impossible, need to find a way to pass it + // Currently, the callback is set as a static variable in TransparentActivity + TransparentActivity.globalContentCallback = globalContentCallback; return config; } diff --git a/sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java b/sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java index 4dcb87591..6e1ea42ba 100644 --- a/sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java +++ b/sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java @@ -35,6 +35,7 @@ public class TransparentActivity extends Activity { TransparentActivityConfig configPortrait = null; WebView webView; RelativeLayout relativeLayout; + static ContentCallback globalContentCallback; @Override protected void onCreate(Bundle savedInstanceState) { @@ -211,8 +212,8 @@ private boolean contentUrlAction(String url, TransparentActivityConfig config, W } if (query.containsKey("close") && Objects.equals(query.get("close"), "1")) { - if (config.globalContentCallback != null) { // TODO: verify this later - config.globalContentCallback.onContentCallback(ContentStatus.CLOSED, query); + if (globalContentCallback != null) { // TODO: verify this later + globalContentCallback.onContentCallback(ContentStatus.CLOSED, query); } ModuleContent.waitForDelay = 2; // this is indicating that we will wait 1 min after closing the content and before fetching the next one finish(); diff --git a/sdk/src/main/java/ly/count/android/sdk/TransparentActivityConfig.java b/sdk/src/main/java/ly/count/android/sdk/TransparentActivityConfig.java index cba8e52b4..466416e48 100644 --- a/sdk/src/main/java/ly/count/android/sdk/TransparentActivityConfig.java +++ b/sdk/src/main/java/ly/count/android/sdk/TransparentActivityConfig.java @@ -11,7 +11,6 @@ class TransparentActivityConfig implements Serializable { Integer height; String url; List listeners; - ContentCallback globalContentCallback; TransparentActivityConfig(Integer x, Integer y, Integer width, Integer height) { this.x = x; @@ -19,6 +18,5 @@ class TransparentActivityConfig implements Serializable { this.width = width; this.height = height; this.listeners = new ArrayList<>(); - this.globalContentCallback = null; } } \ No newline at end of file From 2d265e3d86cab3316cb708f1a31474c26234d04b Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 18 Nov 2024 15:11:32 +0300 Subject: [PATCH 08/32] feat: added support for language to contents1 --- CHANGELOG.md | 2 ++ sdk/src/main/java/ly/count/android/sdk/ConnectionQueue.java | 4 ++-- sdk/src/main/java/ly/count/android/sdk/ModuleContent.java | 5 ++++- .../main/java/ly/count/android/sdk/RequestQueueProvider.java | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eaa44fff..f65bf368b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## XX.XX.XX +* Added language support for the contents. + * Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) ## 24.7.5 diff --git a/sdk/src/main/java/ly/count/android/sdk/ConnectionQueue.java b/sdk/src/main/java/ly/count/android/sdk/ConnectionQueue.java index 3511df032..ba466b26e 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ConnectionQueue.java +++ b/sdk/src/main/java/ly/count/android/sdk/ConnectionQueue.java @@ -823,7 +823,7 @@ public String prepareHealthCheckRequest(String preparedMetrics) { return prepareCommonRequestData() + "&metrics=" + preparedMetrics; } - public String prepareFetchContents(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight, String[] categories) { + public String prepareFetchContents(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight, String[] categories, String language) { JSONObject json = new JSONObject(); try { @@ -841,7 +841,7 @@ public String prepareFetchContents(int portraitWidth, int portraitHeight, int la L.e("Error while preparing fetch contents request"); } - return prepareCommonRequestData() + "&method=queue" + "&category=" + Arrays.asList(categories) + "&resolution=" + UtilsNetworking.urlEncodeString(json.toString()); + return prepareCommonRequestData() + "&method=queue" + "&category=" + Arrays.asList(categories) + "&resolution=" + UtilsNetworking.urlEncodeString(json.toString()) + "&la=" + language; } @Override diff --git a/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java b/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java index ffbf7c673..b6d030590 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java +++ b/sdk/src/main/java/ly/count/android/sdk/ModuleContent.java @@ -8,6 +8,7 @@ import androidx.annotation.Nullable; import java.util.Arrays; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.json.JSONArray; @@ -121,7 +122,9 @@ private String prepareContentFetchRequest(@NonNull DisplayMetrics displayMetrics int landscapeWidth = portrait ? scaledHeight : scaledWidth; int landscapeHeight = portrait ? scaledWidth : scaledHeight; - return requestQueueProvider.prepareFetchContents(portraitWidth, portraitHeight, landscapeWidth, landscapeHeight, categories); + String language = Locale.getDefault().getLanguage().toLowerCase(); + + return requestQueueProvider.prepareFetchContents(portraitWidth, portraitHeight, landscapeWidth, landscapeHeight, categories, language); } boolean validateResponse(@NonNull JSONObject response) { diff --git a/sdk/src/main/java/ly/count/android/sdk/RequestQueueProvider.java b/sdk/src/main/java/ly/count/android/sdk/RequestQueueProvider.java index 25407bcaa..d9497bc6d 100644 --- a/sdk/src/main/java/ly/count/android/sdk/RequestQueueProvider.java +++ b/sdk/src/main/java/ly/count/android/sdk/RequestQueueProvider.java @@ -70,5 +70,5 @@ interface RequestQueueProvider { String prepareHealthCheckRequest(String preparedMetrics); - String prepareFetchContents(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight, String[] categories); + String prepareFetchContents(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight, String[] categories, String language); } From 2a7bbce0e4638dd97a9585f9431d6b85cb562a4c Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:38:24 +0900 Subject: [PATCH 09/32] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f65bf368b..dff92660c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## XX.XX.XX -* Added language support for the contents. +* Added support for localization of content blocks. * Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) From 4fcafa35618b6a96e54cb893b9d100c359ed62a2 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Thu, 21 Nov 2024 09:50:03 +0300 Subject: [PATCH 10/32] feat: RC1 7.6 --- CHANGELOG.md | 2 +- gradle.properties | 2 +- sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java | 2 +- sdk/src/main/java/ly/count/android/sdk/Countly.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70bbfea0e..d74ee68fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## XX.XX.XX +## 24.7.6 * Added support for localization of content blocks. * Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) diff --git a/gradle.properties b/gradle.properties index d7097fa31..5c6a450ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true # RELEASE FIELD SECTION -VERSION_NAME=24.7.5 +VERSION_NAME=24.7.6-RC1 GROUP=ly.count.android POM_URL=https://github.com/Countly/countly-sdk-android POM_SCM_URL=https://github.com/Countly/countly-sdk-android diff --git a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java index a3b5362db..4396ed680 100644 --- a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java +++ b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java @@ -44,7 +44,7 @@ public class TestUtils { public final static String commonAppKey = "appkey"; public final static String commonDeviceId = "1234"; public final static String SDK_NAME = "java-native-android"; - public final static String SDK_VERSION = "24.7.5"; + public final static String SDK_VERSION = "24.7.6-RC1"; public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50; public static class Activity2 extends Activity { diff --git a/sdk/src/main/java/ly/count/android/sdk/Countly.java b/sdk/src/main/java/ly/count/android/sdk/Countly.java index c481e68bb..c058cbc05 100644 --- a/sdk/src/main/java/ly/count/android/sdk/Countly.java +++ b/sdk/src/main/java/ly/count/android/sdk/Countly.java @@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal */ public class Countly { - private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.5"; + private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.6-RC1"; /** * Used as request meta data on every request From 3f5edf74c5cdb6cc8cc988a203571bbe4623c4d5 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Thu, 21 Nov 2024 13:37:54 +0300 Subject: [PATCH 11/32] feat: 24.7.6 --- gradle.properties | 2 +- sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java | 2 +- sdk/src/main/java/ly/count/android/sdk/Countly.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5c6a450ce..2c4f3706c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true # RELEASE FIELD SECTION -VERSION_NAME=24.7.6-RC1 +VERSION_NAME=24.7.6 GROUP=ly.count.android POM_URL=https://github.com/Countly/countly-sdk-android POM_SCM_URL=https://github.com/Countly/countly-sdk-android diff --git a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java index 4396ed680..5e3eda25e 100644 --- a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java +++ b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java @@ -44,7 +44,7 @@ public class TestUtils { public final static String commonAppKey = "appkey"; public final static String commonDeviceId = "1234"; public final static String SDK_NAME = "java-native-android"; - public final static String SDK_VERSION = "24.7.6-RC1"; + public final static String SDK_VERSION = "24.7.6"; public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50; public static class Activity2 extends Activity { diff --git a/sdk/src/main/java/ly/count/android/sdk/Countly.java b/sdk/src/main/java/ly/count/android/sdk/Countly.java index c058cbc05..860f952f1 100644 --- a/sdk/src/main/java/ly/count/android/sdk/Countly.java +++ b/sdk/src/main/java/ly/count/android/sdk/Countly.java @@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal */ public class Countly { - private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.6-RC1"; + private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.6"; /** * Used as request meta data on every request From 63b2416334bce3064f92fdccc71a2fe6d19c5d5b Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 27 Nov 2024 10:04:41 +0300 Subject: [PATCH 12/32] feat: deprecated calls --- .../demo/ActivityExampleAutoViewTracking.java | 5 +- .../android/demo/ActivityExampleFeedback.java | 22 ++ .../main/java/ly/count/android/demo/App.java | 24 +-- .../res/layout/activity_example_feedback.xml | 188 ++++++++++-------- 4 files changed, 142 insertions(+), 97 deletions(-) diff --git a/app/src/main/java/ly/count/android/demo/ActivityExampleAutoViewTracking.java b/app/src/main/java/ly/count/android/demo/ActivityExampleAutoViewTracking.java index 64c570ca9..d9cdf6a31 100644 --- a/app/src/main/java/ly/count/android/demo/ActivityExampleAutoViewTracking.java +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleAutoViewTracking.java @@ -4,6 +4,7 @@ import android.os.Bundle; import android.view.View; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import ly.count.android.sdk.Countly; @@ -40,7 +41,6 @@ public void onClickStartView2(View v) { Toast.makeText(getApplicationContext(), "Clicked startView 2", Toast.LENGTH_SHORT).show(); } - public void onClickPauseViewWithID(View v) { Countly.sharedInstance().views().pauseViewWithID(viewID); Toast.makeText(getApplicationContext(), "Clicked pauseViewWithID 1", Toast.LENGTH_SHORT).show(); @@ -99,9 +99,8 @@ public void onStop() { } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NonNull Configuration newConfig) { super.onConfigurationChanged(newConfig); Countly.sharedInstance().onConfigurationChanged(newConfig); } - } diff --git a/app/src/main/java/ly/count/android/demo/ActivityExampleFeedback.java b/app/src/main/java/ly/count/android/demo/ActivityExampleFeedback.java index 0fcab479b..a1932e7b0 100644 --- a/app/src/main/java/ly/count/android/demo/ActivityExampleFeedback.java +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleFeedback.java @@ -3,6 +3,7 @@ import android.os.Bundle; import android.util.Log; import android.view.View; +import android.widget.Button; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import java.util.List; @@ -23,6 +24,27 @@ public class ActivityExampleFeedback extends AppCompatActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_example_feedback); + + final Button presentSurvey = findViewById(R.id.presentSurvey); + presentSurvey.setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + Countly.sharedInstance().feedback().presentSurvey(ActivityExampleFeedback.this); + } + }); + + final Button presentRating = findViewById(R.id.presentRating); + presentRating.setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + Countly.sharedInstance().feedback().presentRating(ActivityExampleFeedback.this); + } + }); + + final Button presentNPS = findViewById(R.id.presentNPS); + presentNPS.setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + Countly.sharedInstance().feedback().presentNPS(ActivityExampleFeedback.this); + } + }); } public void onClickViewOther02(View v) { diff --git a/app/src/main/java/ly/count/android/demo/App.java b/app/src/main/java/ly/count/android/demo/App.java index b5e63aa66..42f90d236 100644 --- a/app/src/main/java/ly/count/android/demo/App.java +++ b/app/src/main/java/ly/count/android/demo/App.java @@ -25,7 +25,8 @@ import java.util.concurrent.ConcurrentHashMap; import ly.count.android.sdk.Countly; import ly.count.android.sdk.CountlyConfig; -import ly.count.android.sdk.CrashFilterCallback; +import ly.count.android.sdk.CrashData; +import ly.count.android.sdk.GlobalCrashFilterCallback; import ly.count.android.sdk.ModuleLog; import ly.count.android.sdk.messaging.CountlyConfigPush; import ly.count.android.sdk.messaging.CountlyPush; @@ -171,17 +172,6 @@ public void onCreate() { } } }) - - .enableCrashReporting() - .setRecordAllThreadsWithCrash() - .setCustomCrashSegment(customCrashSegmentation) - .setCrashFilterCallback(new CrashFilterCallback() { - @Override - public boolean filterCrash(String crash) { - return crash.contains("crash"); - } - }) - .enableAutomaticViewTracking() // uncomment the line below to enable auto enrolling the user to AB experiments when downloading RC data //.enrollABOnRCDownload() @@ -234,6 +224,16 @@ public boolean filterCrash(String crash) { .setUserProperties(customUserProperties); + config.crashes + .enableCrashReporting() + .enableRecordAllThreadsWithCrash() + .setCustomCrashSegmentation(customCrashSegmentation) + .setGlobalCrashFilterCallback(new GlobalCrashFilterCallback() { + @Override public boolean filterCrash(CrashData crash) { + return crash.getStackTrace().contains("secret"); + } + }); + config.apm.enableAppStartTimeTracking() .enableForegroundBackgroundTracking() .setAppStartTimestampOverride(applicationStartTimestamp); diff --git a/app/src/main/res/layout/activity_example_feedback.xml b/app/src/main/res/layout/activity_example_feedback.xml index 72e13ca06..1f0dc79a7 100644 --- a/app/src/main/res/layout/activity_example_feedback.xml +++ b/app/src/main/res/layout/activity_example_feedback.xml @@ -1,100 +1,124 @@ - -