Skip to content

Commit

Permalink
release 7.0.2 (#98)
Browse files Browse the repository at this point in the history
* fix: fetch instrumentation issue with headers tracking

* cordova release 7.0.2

* cordova release 7.0.2
  • Loading branch information
ndesai-newrelic authored Sep 17, 2024
1 parent 12608eb commit 8efda93
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

# 7.0.2

## Bug Fixes
Fixed an issue with the getHttpHeaderforTracking function, which was causing problems with fetch instrumentation. This fix ensures proper tracking of HTTP requests.

## Updates
Updated the underlying native Android agent to version 7.6.0. This update brings improved performance, stability, and compatibility with the latest Android environments.



# 7.0.1

## New Features and Improvements
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newrelic-cordova-plugin",
"version": "7.0.1",
"version": "7.0.2",
"description": "New Relic Cordova Plugin for iOS and Android",
"repo": "https://github.com/newrelic/newrelic-cordova-plugin/",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="newrelic-cordova-plugin" version="7.0.1">
id="newrelic-cordova-plugin" version="7.0.2">
<name>NewRelic</name>
<description>New Relic Cordova Plugin for iOS and Android</description>
<author>New Relic</author>
Expand All @@ -18,7 +18,7 @@
<engine name="cordova-android" version=">=5.0.0" />
</engines>

<preference name="PLUGIN_VERSION" default="7.0.0" />
<preference name="PLUGIN_VERSION" default="7.0.2" />
<preference name="CRASH_REPORTING_ENABLED" default="true" />
<preference name="DISTRIBUTED_TRACING_ENABLED" default="true" />
<preference name="INTERACTION_TRACING_ENABLED" default="true" />
Expand Down Expand Up @@ -89,7 +89,7 @@

<platform name="android">
<preference name="ANDROID_APP_TOKEN" default="x" />
<preference name="ANDROID_AGENT_VER" default="7.5.1" />
<preference name="ANDROID_AGENT_VER" default="7.6.0" />

<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
13 changes: 12 additions & 1 deletion src/ios/NewRelicCordovaPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,18 @@ - (void)getHTTPHeadersTrackingFor:(CDVInvokedUrlCommand *) command{

CDVPluginResult* pluginResult = nil;
NSArray<NSString*>* headers = [NewRelic httpHeadersAddedForTracking];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: @{@"headersList": headers}];

NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:headers options:NSJSONWritingPrettyPrinted error:&error];
NSString *jsonString = @"[]";
if (!jsonData) {
NSLog(@"Got an error: %@", error);
} else {
jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"%@", jsonString);
}

pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: @{@"headersList": jsonString}];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];

}
Expand Down

0 comments on commit 8efda93

Please sign in to comment.