From 178f56625e63aa679b592995750d109e05f421c1 Mon Sep 17 00:00:00 2001 From: Kenny <105679755+kennyt276@users.noreply.github.com> Date: Tue, 11 Jul 2023 10:25:39 -0700 Subject: [PATCH] feat(newrelic): add shutdown method (#4571) Co-authored-by: Kenny --- .../plugins/newrelic/index.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/newrelic/index.ts b/src/@awesome-cordova-plugins/plugins/newrelic/index.ts index ce89fbc89..667d3c6db 100644 --- a/src/@awesome-cordova-plugins/plugins/newrelic/index.ts +++ b/src/@awesome-cordova-plugins/plugins/newrelic/index.ts @@ -124,7 +124,6 @@ export class NewRelic extends AwesomeCordovaNativePlugin { return; // We add return; here to avoid any IDE / Compiler errors } - /** * Throws a demo run-time exception to test New Relic crash reporting. * @param {string} message An optional argument attached to the exception. @@ -304,7 +303,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin { noticeNetworkFailure(url: string, method: string, startTime: Number, endTime: Number, failure: string): void { return; // We add return; here to avoid any IDE / Compiler errors } - + /** * Records JavaScript errors for ionic. * @param {Error} err The error to report. @@ -315,5 +314,14 @@ export class NewRelic extends AwesomeCordovaNativePlugin { recordError(err: Error): void { return; // We add return; here to avoid any IDE / Compiler errors } - + + /** + * Shut down the agent within the current application lifecycle during runtime. + */ + @Cordova({ + sync: true, + }) + shutdown(): void { + return; // We add return; here to avoid any IDE / Compiler errors + } }