Skip to content

Commit

Permalink
Use new SDK V4.2.0 in demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasia Kubova committed Jun 2, 2021
1 parent a94e99c commit 8ff9385
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/sasquatch/build.gradle
Expand Up @@ -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}"

Expand Down
Expand Up @@ -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();
}
});

Expand Down

0 comments on commit 8ff9385

Please sign in to comment.