Skip to content

Commit 14f0202

Browse files
authored
Merge pull request #522 from Countly/fix_pn_hardkill
Fix pn hardkill
2 parents 2df3346 + 4359ed3 commit 14f0202

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 25.4.8
2+
* Mitigated an issue where push notifications were not shown when consent was not required and app was killed.
3+
14
## 25.4.7
25
* Mitigated an issue where the navigation bar showed an unwanted shadow during content display.
36

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ org.gradle.configureondemand=true
2222
android.useAndroidX=true
2323
android.enableJetifier=true
2424
# RELEASE FIELD SECTION
25-
VERSION_NAME=25.4.7
25+
VERSION_NAME=25.4.8
2626
GROUP=ly.count.android
2727
POM_URL=https://github.com/Countly/countly-sdk-android
2828
POM_SCM_URL=https://github.com/Countly/countly-sdk-android

sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class TestUtils {
4444
public final static String commonAppKey = "appkey";
4545
public final static String commonDeviceId = "1234";
4646
public final static String SDK_NAME = "java-native-android";
47-
public final static String SDK_VERSION = "25.4.7";
47+
public final static String SDK_VERSION = "25.4.8";
4848
public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50;
4949

5050
public static class Activity2 extends Activity {

sdk/src/main/java/ly/count/android/sdk/Countly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal
4747
*/
4848
public class Countly {
4949

50-
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.4.7";
50+
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.4.8";
5151
/**
5252
* Used as request meta data on every request
5353
*/

sdk/src/main/java/ly/count/android/sdk/CountlyConfig.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ public class CountlyConfig {
213213
// If set to true, request queue cleaner will remove all overflow at once instead of gradually (loop limited) removing
214214
boolean disableGradualRequestCleaner = false;
215215

216+
// If set to true, the SDK will not store the default push consent state on initialization for not requiring consent
217+
boolean disableStoringDefaultPushConsent = false;
218+
216219
/**
217220
* THIS VARIABLE SHOULD NOT BE USED
218221
* IT IS ONLY FOR INTERNAL TESTING
@@ -1063,7 +1066,7 @@ public synchronized CountlyConfig setRequestTimeoutDuration(int requestTimeoutDu
10631066
* Set the webview display option for Content and Feedback Widgets
10641067
*
10651068
* @param displayOption IMMERSIVE for full screen with hidden system UI, or
1066-
* SAFE_AREA to use app usable area and not overlap system UI
1069+
* SAFE_AREA to use app usable area and not overlap system UI
10671070
* @return config content to chain calls
10681071
*/
10691072
public synchronized CountlyConfig setWebviewDisplayOption(WebViewDisplayOption displayOption) {
@@ -1100,6 +1103,19 @@ public synchronized CountlyConfig disableGradualRequestCleaner() {
11001103
return this;
11011104
}
11021105

1106+
/**
1107+
* Disable storing the default push consent on initialization.
1108+
* By default, if consent is required and push consent is not set,
1109+
* the SDK was storing push consent as false on initialization.
1110+
* Now, if consent is not required, the SDK will store push consent as true on initialization.
1111+
*
1112+
* @return Returns the same config object for convenient linking
1113+
*/
1114+
public synchronized CountlyConfig disableStoringDefaultPushConsent() {
1115+
this.disableStoringDefaultPushConsent = true;
1116+
return this;
1117+
}
1118+
11031119
/**
11041120
* APM configuration interface to be used with CountlyConfig
11051121
*/

sdk/src/main/java/ly/count/android/sdk/ModuleConsent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ void initFinished(@NonNull final CountlyConfig config) {
284284
if (L.logEnabled()) {
285285
checkAllConsentInternal();
286286
}
287+
} else if (!config.disableStoringDefaultPushConsent) {
288+
//if consent is not required, we need to make sure that the push consent is set to true
289+
//so that the "getConsentPushNoInit" returns true
290+
doPushConsentSpecialAction(true);
287291
}
288292
}
289293

0 commit comments

Comments
 (0)