diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4e8b306..1af367ea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 25.4.8 +* Mitigated an issue where push notifications were not shown when consent was not required and app was killed. + ## 25.4.7 * Mitigated an issue where the navigation bar showed an unwanted shadow during content display. diff --git a/gradle.properties b/gradle.properties index 733f2954a..56f0bc5d8 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=25.4.7 +VERSION_NAME=25.4.8 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 0a5de3b3a..e3de884af 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 = "25.4.7"; + public final static String SDK_VERSION = "25.4.8"; 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 748dda9c6..eeb3859c8 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 = "25.4.7"; + private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.4.8"; /** * Used as request meta data on every request */ diff --git a/sdk/src/main/java/ly/count/android/sdk/CountlyConfig.java b/sdk/src/main/java/ly/count/android/sdk/CountlyConfig.java index 3785cfd30..1ca2b10ca 100644 --- a/sdk/src/main/java/ly/count/android/sdk/CountlyConfig.java +++ b/sdk/src/main/java/ly/count/android/sdk/CountlyConfig.java @@ -213,6 +213,9 @@ public class CountlyConfig { // If set to true, request queue cleaner will remove all overflow at once instead of gradually (loop limited) removing boolean disableGradualRequestCleaner = false; + // If set to true, the SDK will not store the default push consent state on initialization for not requiring consent + boolean disableStoringDefaultPushConsent = false; + /** * THIS VARIABLE SHOULD NOT BE USED * IT IS ONLY FOR INTERNAL TESTING @@ -1063,7 +1066,7 @@ public synchronized CountlyConfig setRequestTimeoutDuration(int requestTimeoutDu * Set the webview display option for Content and Feedback Widgets * * @param displayOption IMMERSIVE for full screen with hidden system UI, or - * SAFE_AREA to use app usable area and not overlap system UI + * SAFE_AREA to use app usable area and not overlap system UI * @return config content to chain calls */ public synchronized CountlyConfig setWebviewDisplayOption(WebViewDisplayOption displayOption) { @@ -1100,6 +1103,19 @@ public synchronized CountlyConfig disableGradualRequestCleaner() { return this; } + /** + * Disable storing the default push consent on initialization. + * By default, if consent is required and push consent is not set, + * the SDK was storing push consent as false on initialization. + * Now, if consent is not required, the SDK will store push consent as true on initialization. + * + * @return Returns the same config object for convenient linking + */ + public synchronized CountlyConfig disableStoringDefaultPushConsent() { + this.disableStoringDefaultPushConsent = true; + return this; + } + /** * APM configuration interface to be used with CountlyConfig */ diff --git a/sdk/src/main/java/ly/count/android/sdk/ModuleConsent.java b/sdk/src/main/java/ly/count/android/sdk/ModuleConsent.java index a4477d57e..2671bfd82 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ModuleConsent.java +++ b/sdk/src/main/java/ly/count/android/sdk/ModuleConsent.java @@ -284,6 +284,10 @@ void initFinished(@NonNull final CountlyConfig config) { if (L.logEnabled()) { checkAllConsentInternal(); } + } else if (!config.disableStoringDefaultPushConsent) { + //if consent is not required, we need to make sure that the push consent is set to true + //so that the "getConsentPushNoInit" returns true + doPushConsentSpecialAction(true); } }