Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
compileSdkVersion = 36
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
kotlinVersion = "2.3.0"
agpVersion = "8.12.0"
}
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
import org.jetbrains.annotations.NotNull;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -107,10 +109,10 @@ public void initCrashReportingNativeSupport(String apiKey, String version, Strin
return;
}

RaygunClient.init(reactContext, apiKey, version);
RaygunClient.enableCrashReporting();
RaygunClient.setOnBeforeSend(new OnBeforeSendHandler());
RaygunClient.setCustomCrashReportingEndpoint(customCrashReportingEndpoint);
RaygunClient.INSTANCE.init(reactContext, apiKey, version);
RaygunClient.INSTANCE.enableCrashReporting();
RaygunClient.INSTANCE.setOnBeforeSend(new OnBeforeSendHandler());
RaygunClient.INSTANCE.setCustomCrashReportingEndpoint(customCrashReportingEndpoint);

crashReportingInitialized = true;
}
Expand Down Expand Up @@ -160,7 +162,8 @@ private static class OnBeforeSendHandler implements CrashReportingOnBeforeSend {
@Override
public RaygunMessage onBeforeSend(RaygunMessage raygunMessage) {
RaygunErrorMessage error = raygunMessage.getDetails().getError();
if (error.getMessage().contains("JavascriptException")) {
String message = error != null ? error.getMessage() : null;
if (message != null && message.contains("JavascriptException")) {
return null;
}
return raygunMessage;
Expand Down Expand Up @@ -350,7 +353,7 @@ public void setUser(ReadableMap userObj) {
userObj.getString("fullName"),
userObj.getString("email"));

RaygunClient.setUser(user);
RaygunClient.INSTANCE.setUser(user);
}

/**
Expand All @@ -360,7 +363,11 @@ public void setUser(ReadableMap userObj) {
*/
@ReactMethod
public void setTags(ReadableArray tags) {
RaygunClient.setTags(tags.toArrayList());
List<String> tagList = new ArrayList<>();
for (int i = 0; i < tags.size(); i++) {
tagList.add(tags.getString(i));
}
RaygunClient.INSTANCE.setTags(tagList);
}

/**
Expand All @@ -371,7 +378,7 @@ public void setTags(ReadableArray tags) {
*/
@ReactMethod
public void setCustomData(ReadableMap customData) {
RaygunClient.setCustomData(customData.toHashMap());
RaygunClient.INSTANCE.setCustomData(customData.toHashMap());
}

/**
Expand Down Expand Up @@ -403,15 +410,15 @@ public void recordBreadcrumb(ReadableMap breadcrumb) {
.customData(customData.toHashMap())
.build();

RaygunClient.recordBreadcrumb(breadcrumbMessage);
RaygunClient.INSTANCE.recordBreadcrumb(breadcrumbMessage);
}

/**
* Clear the breadcrumbs.
*/
@ReactMethod
public void clearBreadcrumbs() {
RaygunClient.clearBreadcrumbs();
RaygunClient.INSTANCE.clearBreadcrumbs();
}
//#endregion--------------------------------------------------------------------------------------

Expand Down
Loading