TP-80791 | Pulse SDK Integration

This commit is contained in:
yashmantri
2024-09-04 15:32:08 +05:30
parent 66689301ec
commit f218a6b77c
2 changed files with 8 additions and 4 deletions

View File

@@ -148,8 +148,8 @@ public class DeviceUtilsModule extends ReactContextBaseJavaModule {
public void setUserId(String userId) {
if (isAlfredEnabledFromFirebase) {
AlfredManager.INSTANCE.getConfig$navi_alfred_release().setUserId(userId);
PulseManager.INSTANCE.setUserId(userId);
}
PulseManager.INSTANCE.setUserId(userId);
}
@ReactMethod

View File

@@ -107,7 +107,7 @@ public class MainApplication extends Application implements ReactApplication {
PulseSDKConfig.Configuration pulseConfig =
new PulseSDKConfig.Configuration.Builder()
.setAppName(BuildConfig.APP_NAME)
.setAppName("collections-agent-app")
.setAppVersion(String.valueOf(BuildConfig.VERSION_CODE))
.setAppVersionName(BuildConfig.VERSION_NAME)
.setDestinationUrl(getDestinationUrl(BuildConfig.BUILD_FLAVOR))
@@ -177,7 +177,9 @@ public class MainApplication extends Application implements ReactApplication {
if (isAlfredEnabledFromFirebase && AlfredManager.INSTANCE.isAlfredRecordingEnabled()
&& alfredConfig.getAnrEnableStatus() && MainActivity.isAppInForeground()) {
anrEventProperties.put(STACK_TRACE, error.getCause().getStackTrace()[0].toString());
PulseManager.INSTANCE.trackEvent("COSMOS_ANR", anrEventProperties);
if("release".equals(BuildConfig.BUILD_TYPE)) {
PulseManager.INSTANCE.trackEvent("COSMOS_ANR", anrEventProperties);
}
AlfredManager.INSTANCE.handleAnrEvent(anrEventProperties);
}
}).start();
@@ -205,7 +207,9 @@ public class MainApplication extends Application implements ReactApplication {
if (stackTraceElement != null) {
crashEventProperties.put(STACK_TRACE, stackTraceElement.toString());
}
PulseManager.INSTANCE.trackEvent("COSMOS_CRASH", crashEventProperties);
if("release".equals(BuildConfig.BUILD_TYPE)) {
PulseManager.INSTANCE.trackEvent("COSMOS_CRASH", crashEventProperties);
}
AlfredManager.INSTANCE.handleCrashEvent(crashEventProperties);
}
} finally {