diff --git a/src/android/io/sentry/SentryCordova.java b/src/android/io/sentry/SentryCordova.java index 9ae3742..64671d2 100755 --- a/src/android/io/sentry/SentryCordova.java +++ b/src/android/io/sentry/SentryCordova.java @@ -81,8 +81,10 @@ public boolean execute(String action, JSONArray args, final CallbackContext call try (FileOutputStream out = new FileOutputStream(installation)) { out.write(bytes); logger.info("Successfully captured envelope."); + callbackContext.success(); } catch (Exception e) { logger.info("Error writing envelope."); + callbackContext.error("Error writing envelope."); } break; @@ -369,8 +371,10 @@ private void addBreadcrumb(final JSONObject jsonBreadcrumb, final CallbackContex scope.addBreadcrumb(breadcrumb); logger.info("Send breadcrumb successful"); + callbackContext.success(); } catch (JSONException e) { logger.warning("Error deserializing breadcrumb"); + callbackContext.error("Failed to add breadcrumb"); } }); } diff --git a/src/ios/SentryCordova.m b/src/ios/SentryCordova.m index 743af87..ae57170 100755 --- a/src/ios/SentryCordova.m +++ b/src/ios/SentryCordova.m @@ -207,12 +207,20 @@ - (void)addBreadcrumb:(CDVInvokedUrlCommand *)command { [scope addBreadcrumb:breadcrumbInstance]; }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)clearBreadcrumbs:(CDVInvokedUrlCommand *)command { [SentrySDK configureScope:^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs]; }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)setUser:(CDVInvokedUrlCommand *)command { @@ -242,6 +250,10 @@ - (void)setUser:(CDVInvokedUrlCommand *)command { [scope setUser:userInstance]; } }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)setExtra:(CDVInvokedUrlCommand *)command { @@ -251,6 +263,10 @@ - (void)setExtra:(CDVInvokedUrlCommand *)command { [SentrySDK configureScope:^(SentryScope *_Nonnull scope) { [scope setExtraValue:extra forKey:key]; }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)setContext:(CDVInvokedUrlCommand *)command { @@ -260,6 +276,10 @@ - (void)setContext:(CDVInvokedUrlCommand *)command { [SentrySDK configureScope:^(SentryScope *_Nonnull scope) { [scope setContextValue:context forKey:key]; }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)setTag:(CDVInvokedUrlCommand *)command { @@ -269,6 +289,10 @@ - (void)setTag:(CDVInvokedUrlCommand *)command { [SentrySDK configureScope:^(SentryScope *_Nonnull scope) { [scope setTagValue:value forKey:key]; }]; + + CDVPluginResult *result = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } - (void)crash:(CDVInvokedUrlCommand *)command {