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(); } });