The official New Relic Cordova plugin for iOS and Android allows developers to easily embed the mobile agents into Cordova applications. Written in JavaScript, the plugin automatically includes New Relic's native agents to provide mobile monitoring and performance visibility.
Features
The New Relic Cordova plugin will:
- Detect the platforms added to your Cordova application and apply the most recent release of the appropriate New Relic mobile agent (Android or iOS).
- Add post-build scripts for uploading iOS symbolication files.
- Upload Android Proguard mapping files.
- Automatically instrument mobile applications built via Cordova.
For more information, see New Relic Cordova Plugin on Github.
Compatibility and requirements
The New Relic Cordova plugin requires:
- Cordova 7.x or higher
- Node 6.0 or higher
- Cordova CLI tools
- An Android or iOS Cordova platform for your project
- Mobile application tokens
Network requests are only recorded on iOS devices for webviews and native frameworks. Android only records native network calls.
Cordova will typically handle exceptions by default. Our Cordova plugin will record uncaught exceptions (crashes) that Cordova does not handle.
Install the Cordova plugin
Before installing, make sure you have fulfilled the prerequisites for adding the Android or iOS platform to your Cordova project. Then follow these steps to install the Cordova plugin:
If you do not already have an account, signup (it's free).
If applicable, use separate application tokens for iOS and Android.
From your New Relic applications page, copy the application tokens for the Cordova platforms you are building on.
Change to your Cordova project directory, then add the plugin to your project with the Cordova command line tool. Use the
--variable
argument to pass application tokens to the plugin:# Install from github repositorycordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}"Deploy your app.
View your performance data from the mobile monitoring UI.
Update the plugin
Easily update the New Relic Cordova plugin to the latest released version using the following command:
cordova plugin update
Default Cordova attributes
The Cordova plugin collects the following attributes:
Attribute | Description |
---|---|
| A unique identifier for the monitored app. For example, 35091. |
| Indicates the technical build number of the binary that crashed. As a developer, you can use this attribute to see exactly which build of your app crashed. |
| The name of the monitored app. For example, New Relic iOS. |
| The version number of the monitored app. For example, 2.2.9. |
| A New Relic unique version number of the monitored app. |
| The processor architecture of the device such as armv7, arm64. |
| The Autonomous System Number which the device was associated with when the data was reported. |
| The telecom owner of the ASN. |
| The mobile network over which the app transferred data, such as WiFi, Verizon, Sprint, etc. |
| The type of data being collected. The standard categories are Session, Interaction, and Crash. If you've added custom events via the API, they use the Custom category. |
| The city where the monitored app is located, such as Portland or Seattle. |
| The country where the monitored app is located. For example, GB for the United Kingdom. For a list of country codes, see ISO 3166-1 alpha-2. |
| The exception associated with the crash, if one is present. For example, |
| The message associated with the crash, if one is present. |
| The name of the device, such as iPad Air or Galaxy S5. |
| The category of the device, such as iPod Touch or iPad. |
| The manufacturer of the device. For example, Motorola or HTC. |
| The model number of the device. For example, XT1039 or SM-G900F. |
| The total time, in seconds, for the interaction to render on the device. In addition to render time, this usually includes all external calls associated with the interaction. |
| If |
| The last interaction before a crash event, if one is present. For example, App Launch. |
| The total amount of memory, in MB, used by the application. Updated every 60 seconds. |
| The name of the interaction associated with the event. For example, ApplicationsListFragment or NavigationDrawerFragment. |
| The version number of the agent running on the application. For example, 4.232.0. |
| The simplified version number of the app's host operating system, such as iOS 7, as compared to iOS 7.0.4. |
| The name of app's host operating system, for example, iOS or Android. |
| The exact version number of the app's host operating system, such as iOS 7.0.4, as compared to iOS 7. |
| The specific region within a country where the monitored app is located. In the United States, regions are states. |
| The length of time for which the user used the application in seconds. If the session crashes, For sessions longer than 10 minutes, events in the Interaction and Custom event categories are sent to Insights while the session is ongoing, and therefore do not have |
| A unique identifier for a single user session. |
| The time, in seconds, since the interaction before a crash event. |
| The time, in seconds, from the beginning of the mobile session to the time the event occurred. The event can be a built-in event category of Session, Interaction or Crash, as well as any Custom events sent via the agent API. |
| When an upgrade is detected, specifies the version number of the old version from which the user upgraded. For example, |
| A unique identifier for a specific installation of the app on a particular device, such as B8B0BC30-0235-11E4-9191-0800200C9A66. |