diff --git a/CHANGELOG.md b/CHANGELOG.md index 59477dc..25e4b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +# 6.2.9 +* A crash issue in the iOS app has been resolved when the Cordova agent receives responses in the form of blobs or array buffers. +* The native iOS agent has been updated to version 7.4.11, which brings performance enhancements and bug fixes. +* Similarly, the native Android agent has been upgraded to version 7.3.1, improving stability and introducing new features. + + # 6.2.8 * * Updated native iOS Agent: We've upgraded the native iOS agent to version 7.4.10, which includes performance improvements and bug fixes. diff --git a/package.json b/package.json index 555b728..289f715 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newrelic-cordova-plugin", - "version": "6.2.8", + "version": "6.2.9", "description": "New Relic Cordova Plugin for iOS and Android", "repo": "https://github.com/newrelic/newrelic-cordova-plugin/", "scripts": { diff --git a/plugin.xml b/plugin.xml index d836f59..994d3ff 100644 --- a/plugin.xml +++ b/plugin.xml @@ -6,7 +6,7 @@ + id="newrelic-cordova-plugin" version="6.2.9"> NewRelic New Relic Cordova Plugin for iOS and Android New Relic @@ -18,7 +18,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/src/android/NewRelicCordovaPlugin.java b/src/android/NewRelicCordovaPlugin.java index b8c17ef..c8a8aff 100644 --- a/src/android/NewRelicCordovaPlugin.java +++ b/src/android/NewRelicCordovaPlugin.java @@ -272,9 +272,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo traceHeadersMap = new Gson().fromJson(String.valueOf(traceAttributes), Map.class); } - JSONObject params = args.getJSONObject(8); + Object params = args.get(8); Map paramsMap = new HashMap<>(); - if (params != null) { + if (params instanceof JSONObject) { paramsMap = new Gson().fromJson(String.valueOf(params), Map.class); } diff --git a/src/ios/NewRelicCordovaPlugin.m b/src/ios/NewRelicCordovaPlugin.m index 95561df..351fbb3 100644 --- a/src/ios/NewRelicCordovaPlugin.m +++ b/src/ios/NewRelicCordovaPlugin.m @@ -264,11 +264,30 @@ - (void)noticeHttpTransaction:(CDVInvokedUrlCommand *)command { NSNumber* bytesreceived = [command.arguments objectAtIndex:6]; NSString* body = [command.arguments objectAtIndex:7]; + NSDictionary* params; + if([command.arguments objectAtIndex:8] == [NSNull null] ){ + params = nil; + } + else {params = [command.arguments objectAtIndex:8]; + } + + NSDictionary* traceAttributes; + if([command.arguments objectAtIndex:9] == [NSNull null] ){ + traceAttributes = nil; + } + else { + traceAttributes = [command.arguments objectAtIndex:9]; + } NSURL *nsurl = [NSURL URLWithString:url]; - NSData* data = [body dataUsingEncoding:NSUTF8StringEncoding]; + NSData* data; + if (body == [NSNull null]) { + data = nil; + } else { + data = [body dataUsingEncoding:NSUTF8StringEncoding]; + } - [NewRelic noticeNetworkRequestForURL:nsurl httpMethod:method startTime:[startTime doubleValue] endTime:[endTime doubleValue] responseHeaders:nil statusCode:(long)[status integerValue] bytesSent:(long)[bytesSent integerValue] bytesReceived:(long)[bytesreceived integerValue] responseData:data traceHeaders:nil andParams:nil]; + [NewRelic noticeNetworkRequestForURL:nsurl httpMethod:method startTime:[startTime doubleValue] endTime:[endTime doubleValue] responseHeaders:nil statusCode:(long)[status integerValue] bytesSent:(long)[bytesSent integerValue] bytesReceived:(long)[bytesreceived integerValue] responseData:data traceHeaders:traceAttributes andParams:params]; } - (void)crashNow:(CDVInvokedUrlCommand *)command {