diff --git a/.github/workflows/build_and_test_sdk.yml b/.github/workflows/build_and_test_sdk.yml index 337a514f4..c4b9e82ad 100644 --- a/.github/workflows/build_and_test_sdk.yml +++ b/.github/workflows/build_and_test_sdk.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Install Docker to the Runner - run: sudo apt-get install docker + run: sudo apt-get install containerd.io - name: Pull Emulator from the Repo run: docker pull ${{ env.EMULATOR_REPO }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eaa44fff..5f4642eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ -## XX.XX.XX +## 25.4.0 +* ! Minor breaking change ! Removed Secure.ANDROID_ID usage in device id generation. The SDK now exclusively uses random UUIDs for device id generation. +* ! Minor breaking change ! Server Configuration is now enabled by default. Changes made on SDK Manager > SDK Configuration on your server will affect SDK behavior directly. + +* Added a Content feature method "refreshContentZone" that does a manual refresh. +* Extended server configuration capabilities of the SDK. +* Added a config method to provide server config in the initialization "setSDKBehaviorSettings(String)". +* Added a new interface "CountlyNotificationButtonURLHandler" to allow custom handling of URLs when notification buttons are clicked. Could be set by "CountlyConfigPush.setNotificationButtonURLHandler" + +* Mitigated an issue that caused PN message data collision if two message with same ID was received. + +* Removed the deprecated function "CountlyConfig.setIdMode(idMode)" + +* Deprecated the experimental configuration function enableServerConfiguration. + +## 25.1.1 +* Mitigated an issue where after closing a content, they were not being fetched again. + +## 25.1.0 +* Improved content size management of content blocks. + +* Mitigated an issue where, the action bar was overlapping with the content display. +* Improved the custom CertificateTrustManager to handle domain-specific configurations by supporting hostname-aware checkServerTrusted calls. + +## 24.7.8 +* Added a config option to content (setZoneTimerInterval) to set content zone timer. (Experimental!) + +## 24.7.7 +* Mitigated an issue where an automatically closed autostopped view's duration could have increased when opening new views +* Mitigated an issue where, on Android 35 and above, the navigation bar was overlapping with the content display. + +## 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!) +* Fixed a bug where passing the global content callback was not possible. +* Mitigated an issue related to content actions navigation. +* Mitigated an issue that parsing internal content event segmentation. ## 24.7.5 * ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked. diff --git a/app-kotlin/src/main/java/ly/count/android/demo/kotlin/App.kt b/app-kotlin/src/main/java/ly/count/android/demo/kotlin/App.kt index 2cfe3aaa5..2a9a26d03 100644 --- a/app-kotlin/src/main/java/ly/count/android/demo/kotlin/App.kt +++ b/app-kotlin/src/main/java/ly/count/android/demo/kotlin/App.kt @@ -27,10 +27,9 @@ class App : Application() { .setDeviceId( "myDeviceId" ) - .enableCrashReporting() - .setRecordAllThreadsWithCrash() .setLoggingEnabled(true) - .setViewTracking(false) + + countlyConfig.crashes.enableCrashReporting().enableRecordAllThreadsWithCrash() Countly.sharedInstance().init(countlyConfig) } diff --git a/app-native/src/main/java/ly/count/android/demo/crash/App.java b/app-native/src/main/java/ly/count/android/demo/crash/App.java index b803a2cb1..4593a8795 100644 --- a/app-native/src/main/java/ly/count/android/demo/crash/App.java +++ b/app-native/src/main/java/ly/count/android/demo/crash/App.java @@ -25,9 +25,11 @@ public class App extends Application { CountlyConfig config = new CountlyConfig(this, COUNTLY_APP_KEY, COUNTLY_SERVER_URL).setDeviceId("4432") .setLoggingEnabled(true) - .enableCrashReporting() - .setViewTracking(true) + .enableAutomaticViewTracking() .setRequiresConsent(false); + + config.crashes.enableCrashReporting(); + Countly.sharedInstance().init(config); CountlyNative.initNative(getApplicationContext()); diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3449aa7ea..63643611c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -101,6 +101,11 @@ android:label="@string/activity_name_feedback" android:configChanges="orientation|screenSize"/> + + 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/ActivityExampleContentZone.java b/app/src/main/java/ly/count/android/demo/ActivityExampleContentZone.java new file mode 100644 index 000000000..7d728f672 --- /dev/null +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleContentZone.java @@ -0,0 +1,42 @@ +package ly.count.android.demo; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; +import androidx.appcompat.app.AppCompatActivity; +import java.util.UUID; +import ly.count.android.sdk.Countly; + +public class ActivityExampleContentZone extends AppCompatActivity { + + Activity activity; + EditText deviceIdEditText; + + @Override + public void onCreate(Bundle savedInstanceState) { + activity = this; + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_example_content_zone); + deviceIdEditText = findViewById(R.id.editTextDeviceIdContentZone); + } + + public void onClickEnterContentZone(View v) { + Countly.sharedInstance().contents().enterContentZone(); + } + + public void onClickExitContentZone(View v) { + Countly.sharedInstance().contents().exitContentZone(); + } + + public void onClickRefreshContentZone(View v) { + Countly.sharedInstance().contents().refreshContentZone(); + } + + public void onClickChangeDeviceIdContentZone(View v) { + String deviceId = deviceIdEditText.getText().toString(); + String newDeviceId = deviceId.isEmpty() ? UUID.randomUUID().toString() : deviceId; + + Countly.sharedInstance().deviceId().setID(newDeviceId); + } +} 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/ActivityExampleOthers.java b/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java index a50b1938c..4cbccbe72 100644 --- a/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java @@ -137,12 +137,4 @@ public void onClickUpdateSession(View v) { public void onClickEndSession(View v) { Countly.sharedInstance().sessions().endSession(); } - - public void onClickFetchContents(View v) { - Countly.sharedInstance().contents().enterContentZone(); - } - - public void onClickExitContents(View v) { - Countly.sharedInstance().contents().exitContentZone(); - } } 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/java/ly/count/android/demo/MainActivity.java b/app/src/main/java/ly/count/android/demo/MainActivity.java index 307e1a668..4b3cd2e78 100644 --- a/app/src/main/java/ly/count/android/demo/MainActivity.java +++ b/app/src/main/java/ly/count/android/demo/MainActivity.java @@ -141,4 +141,8 @@ public void onClickButtonDeviceId(View v) { public void onClickButtonRatings(View v) { startActivity(new Intent(this, ActivityExampleFeedback.class)); } + + public void onClickContentZone(View v) { + startActivity(new Intent(this, ActivityExampleContentZone.class)); + } } diff --git a/app/src/main/res/layout/activity_example_content_zone.xml b/app/src/main/res/layout/activity_example_content_zone.xml new file mode 100644 index 000000000..27adc9c76 --- /dev/null +++ b/app/src/main/res/layout/activity_example_content_zone.xml @@ -0,0 +1,56 @@ + + + + + + + + +