From 8ff938531785ed9999eb517ce9796c3cbff11710 Mon Sep 17 00:00:00 2001 From: Anastasia Kubova Date: Wed, 2 Jun 2021 12:20:43 +0300 Subject: [PATCH] Use new SDK V4.2.0 in demo app --- apps/sasquatch/build.gradle | 2 +- .../activities/SettingsActivity.java | 26 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/apps/sasquatch/build.gradle b/apps/sasquatch/build.gradle index 7cdbe9b74..e6f643adc 100644 --- a/apps/sasquatch/build.gradle +++ b/apps/sasquatch/build.gradle @@ -90,7 +90,7 @@ dependencies { projectDependencyImplementation project(':sdk:appcenter-analytics') projectDependencyImplementation project(':sdk:appcenter-crashes') - def appCenterSdkVersion = "4.1.1" + def appCenterSdkVersion = "4.2.0" mavenCentralDependencyImplementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}" mavenCentralDependencyImplementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}" diff --git a/apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/SettingsActivity.java b/apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/SettingsActivity.java index 8ea894ac7..68543d268 100644 --- a/apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/SettingsActivity.java +++ b/apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/SettingsActivity.java @@ -156,34 +156,12 @@ public void onEvent(int event, @Nullable String path) { @Override public void setEnabled(boolean enabled) { - try { - - /* - * TODO replace the next line with 'AppCenter.setNetworkRequestsAllowed(enabled);' - * when updating the demo during release process. - */ - Method setNetworkRequestsAllowedMethod = AppCenter.class.getMethod("setNetworkRequestsAllowed", boolean.class); - setNetworkRequestsAllowedMethod.invoke(null, enabled); - } catch (Exception e) { - Log.d(LOG_TAG, "No setNetworkRequestsAllowed API in this build"); - } + AppCenter.setNetworkRequestsAllowed(enabled); } @Override public boolean isEnabled() { - try { - - /* - * TODO replace the next line with 'AppCenter.isNetworkRequestsAllowed();' - * when updating the demo during release process. - */ - Method isNetworkRequestsAllowedMethod = AppCenter.class.getMethod("isNetworkRequestsAllowed"); - Object value = isNetworkRequestsAllowedMethod.invoke(null); - return (boolean)value; - } catch (Exception e) { - Log.d(LOG_TAG, "No isNetworkRequestsAllowed API in this build"); - return true; - } + return AppCenter.isNetworkRequestsAllowed(); } });