docs(newrelic): update docs (#4420)

* Adding Newrelic support for Awesome plugins

* Adding more static methods for newrelic cordova plugin

* adding documentation for newrelic plugin

* Updating newrelic cordova plugin repo

* Update index.ts

* fix:updating correct cordova plugin repo

* docs: added Documentation for NewRelic Plugin

* ADDED Record Error and Updated set Attribute Method

Co-authored-by: Daniel Sogl <daniel@sogls.de>
This commit is contained in:
ndesai-newrelic 2022-12-31 02:04:42 -06:00 committed by GitHub
parent 0579e67e96
commit 82f7fd9e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 15 deletions

View File

@ -0,0 +1,20 @@
# newrelic mobile
```
$ ionic cordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}"
$ npm install @awesome-cordova-plugins/newrelic
```
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/newrelic/)
Plugin Repo: [https://github.com/newrelic/newrelic-cordova-plugin](https://github.com/newrelic/newrelic-cordova-plugin)
This NewRelic plugin collect crashes, network traffic, and other information for hybrid apps using native components.
## Supported platforms
- Android
- iOS

View File

@ -29,7 +29,7 @@ import { Observable } from 'rxjs';
pluginRef: 'NewRelic', // the variable reference to call the plugin, example: navigator.geolocation pluginRef: 'NewRelic', // the variable reference to call the plugin, example: navigator.geolocation
repo: 'https://github.com/newrelic/newrelic-cordova-plugin', // the github repository URL for the plugin repo: 'https://github.com/newrelic/newrelic-cordova-plugin', // the github repository URL for the plugin
install: install:
'ionic cordova plugin add https://github.com/ndesai-newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}"', // OPTIONAL install command, in case the plugin requires variables 'ionic cordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}"', // OPTIONAL install command, in case the plugin requires variables
installVariables: ['IOS_APP_TOKEN', 'ANDROID_APP_TOKEN'], // OPTIONAL the plugin requires variables installVariables: ['IOS_APP_TOKEN', 'ANDROID_APP_TOKEN'], // OPTIONAL the plugin requires variables
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
}) })
@ -56,7 +56,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({ @Cordova({
sync: true, sync: true,
}) })
setAttribute(name: string, value: string): void { setAttribute(name: string, value: any): void {
return; // We add return; here to avoid any IDE / Compiler errors return; // We add return; here to avoid any IDE / Compiler errors
} }
@ -124,19 +124,6 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
return; // We add return; here to avoid any IDE / Compiler errors return; // We add return; here to avoid any IDE / Compiler errors
} }
/**
* Records JavaScript errors for ionic.
* @param {string} name The name of the error.
* @param {string} message The message of the error.
* @param {string} stack The error stack of the error.
* @param {boolean} isFatal The flag for whether the error is fatal.
*/
@Cordova({
sync: true,
})
recordError(name: string, message: string, stack: string, isFatal: boolean): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
/** /**
* Throws a demo run-time exception to test New Relic crash reporting. * Throws a demo run-time exception to test New Relic crash reporting.
@ -317,4 +304,16 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
noticeNetworkFailure(url: string, method: string, startTime: Number, endTime: Number, failure: string): void { noticeNetworkFailure(url: string, method: string, startTime: Number, endTime: Number, failure: string): void {
return; // We add return; here to avoid any IDE / Compiler errors return; // We add return; here to avoid any IDE / Compiler errors
} }
/**
* Records JavaScript errors for ionic.
* @param {Error} err The error to report.
*/
@Cordova({
sync: true,
})
recordError(err: Error): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
} }