From e6f9333d9914e51b99dad0acac39903264f0a9d1 Mon Sep 17 00:00:00 2001 From: ndesai Date: Mon, 23 Sep 2024 10:11:51 -0500 Subject: [PATCH 1/2] fix:iOS namespace issue #45 --- CHANGELOG.md | 3 + .../NewRelic.MAUI.Plugin.csproj | 4 +- .../Android/NewRelicMethodsImplementation.cs | 2 +- .../iOS/NewRelicMethodsImplementation.cs | 70 +++++++++---------- NewRelic.MAUI.iOS.Binding/ApiDefinition.cs | 2 +- .../NewRelic.MAUI.iOS.Binding.csproj | 2 +- NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs | 2 +- 7 files changed, 44 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c235e2b..cdc07d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +# 1.1.2 + +- Resolved the iOS bindings namespace issue which was causing conflicts for customers due to the namespace clash with the newrelic package. # 1.1.1 diff --git a/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj b/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj index 37a0948..ee5cfa2 100644 --- a/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj +++ b/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj @@ -8,7 +8,7 @@ true enable NewRelic.MAUI.Plugin - 1.1.1 + 1.1.2 New Relic Plugin for .NET MAUI mobile apps With the New Relic .NET MAUI mobile plugin, your team can monitor the performance of .NET MAUI apps and identify code errors. The plugin collects crash data, network traffic, and other information for your apps using native components. New Relic @@ -35,6 +35,6 @@ - + \ No newline at end of file diff --git a/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs b/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs index 7969c93..d1956df 100644 --- a/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs +++ b/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs @@ -126,7 +126,7 @@ public void Start(string applicationToken, AgentStartConfiguration agentConfig = var newRelic = NRAndroidAgent.WithApplicationToken(applicationToken) - .WithApplicationFramework(Com.Newrelic.Agent.Android.ApplicationFramework.Maui, "1.1.1") + .WithApplicationFramework(Com.Newrelic.Agent.Android.ApplicationFramework.Maui, "1.1.2") .WithLoggingEnabled(agentConfig.loggingEnabled) .WithLogLevel(logLevelDict[agentConfig.logLevel]); diff --git a/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs b/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs index 3b8065c..7e916af 100644 --- a/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs +++ b/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs @@ -5,7 +5,7 @@ using Foundation; using System.Diagnostics; -using NRIosAgent = iOS.NewRelic.NewRelic; +using NRIosAgent = MauiiOS.NewRelic.NewRelic; namespace NewRelic.MAUI.Plugin; @@ -14,24 +14,24 @@ public class NewRelicMethodsImplementation : INewRelicMethods { private bool _isUncaughtExceptionHandled; - private Dictionary logLevelDict = new Dictionary() + private Dictionary logLevelDict = new Dictionary() { - { LogLevel.ERROR, iOS.NewRelic.NRLogLevels.Error }, - { LogLevel.WARNING, iOS.NewRelic.NRLogLevels.Warning }, - { LogLevel.INFO, iOS.NewRelic.NRLogLevels.Info }, - { LogLevel.VERBOSE, iOS.NewRelic.NRLogLevels.Verbose }, - { LogLevel.AUDIT, iOS.NewRelic.NRLogLevels.Audit } + { LogLevel.ERROR, MauiiOS.NewRelic.NRLogLevels.Error }, + { LogLevel.WARNING, MauiiOS.NewRelic.NRLogLevels.Warning }, + { LogLevel.INFO, MauiiOS.NewRelic.NRLogLevels.Info }, + { LogLevel.VERBOSE, MauiiOS.NewRelic.NRLogLevels.Verbose }, + { LogLevel.AUDIT, MauiiOS.NewRelic.NRLogLevels.Audit } }; private Dictionary networkFailureDict = new Dictionary() { - { NetworkFailure.Unknown, (nint) iOS.NewRelic.NRNetworkFailureCode.Unknown }, - { NetworkFailure.BadURL, (nint) iOS.NewRelic.NRNetworkFailureCode.BadURL }, - { NetworkFailure.TimedOut, (nint) iOS.NewRelic.NRNetworkFailureCode.TimedOut }, - { NetworkFailure.CannotConnectToHost, (nint) iOS.NewRelic.NRNetworkFailureCode.CannotConnectToHost }, - { NetworkFailure.DNSLookupFailed, (nint) iOS.NewRelic.NRNetworkFailureCode.DNSLookupFailed }, - { NetworkFailure.BadServerResponse, (nint) iOS.NewRelic.NRNetworkFailureCode.BadServerResponse }, - { NetworkFailure.SecureConnectionFailed, (nint) iOS.NewRelic.NRNetworkFailureCode.SecureConnectionFailed } + { NetworkFailure.Unknown, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.Unknown }, + { NetworkFailure.BadURL, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.BadURL }, + { NetworkFailure.TimedOut, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.TimedOut }, + { NetworkFailure.CannotConnectToHost, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.CannotConnectToHost }, + { NetworkFailure.DNSLookupFailed, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.DNSLookupFailed }, + { NetworkFailure.BadServerResponse, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.BadServerResponse }, + { NetworkFailure.SecureConnectionFailed, (nint) MauiiOS.NewRelic.NRNetworkFailureCode.SecureConnectionFailed } }; private Dictionary metricUnitDict = new Dictionary() @@ -51,66 +51,66 @@ public void Start(string applicationToken, AgentStartConfiguration agentConfig = } NRIosAgent.EnableCrashReporting(agentConfig.crashReportingEnabled); - NRIosAgent.SetPlatform(iOS.NewRelic.NRMAApplicationPlatform.Maui); - iOS.NewRelic.NewRelic.SetPlatformVersion("1.1.1"); + NRIosAgent.SetPlatform(MauiiOS.NewRelic.NRMAApplicationPlatform.Maui); + MauiiOS.NewRelic.NewRelic.SetPlatformVersion("1.1.2"); - iOS.NewRelic.NRLogger.SetLogLevels((uint)logLevelDict[agentConfig.logLevel]); + MauiiOS.NewRelic.NRLogger.SetLogLevels((uint)logLevelDict[agentConfig.logLevel]); if (!agentConfig.loggingEnabled) { - iOS.NewRelic.NRLogger.SetLogLevels((uint)iOS.NewRelic.NRLogLevels.None); + MauiiOS.NewRelic.NRLogger.SetLogLevels((uint)MauiiOS.NewRelic.NRLogLevels.None); } if (!agentConfig.networkErrorRequestEnabled) { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); } if (!agentConfig.networkRequestEnabled) { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); } if (!agentConfig.interactionTracingEnabled) { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.InteractionTracing); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.InteractionTracing); } if (!agentConfig.webViewInstrumentation) { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.WebViewInstrumentation); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.WebViewInstrumentation); } if (agentConfig.fedRampEnabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.FedRampEnabled); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.FedRampEnabled); } if (agentConfig.offlineStorageEnabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.OfflineStorage); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.OfflineStorage); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.OfflineStorage); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.OfflineStorage); } if (agentConfig.newEventSystemEnabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.NewEventSystem); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.NewEventSystem); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.NewEventSystem); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.NewEventSystem); } if (agentConfig.backgroundReportingEnabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.BackgroundReporting); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.BackgroundReporting); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.BackgroundReporting); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.BackgroundReporting); } @@ -269,11 +269,11 @@ public void NetworkRequestEnabled(bool enabled) { if (enabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.NetworkRequestEvents); } return; } @@ -282,11 +282,11 @@ public void NetworkErrorRequestEnabled(bool enabled) { if (enabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.RequestErrorEvents); } return; } @@ -295,11 +295,11 @@ public void HttpResponseBodyCaptureEnabled(bool enabled) { if (enabled) { - NRIosAgent.EnableFeatures(iOS.NewRelic.NRMAFeatureFlags.HttpResponseBodyCapture); + NRIosAgent.EnableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.HttpResponseBodyCapture); } else { - NRIosAgent.DisableFeatures(iOS.NewRelic.NRMAFeatureFlags.HttpResponseBodyCapture); + NRIosAgent.DisableFeatures(MauiiOS.NewRelic.NRMAFeatureFlags.HttpResponseBodyCapture); } return; } diff --git a/NewRelic.MAUI.iOS.Binding/ApiDefinition.cs b/NewRelic.MAUI.iOS.Binding/ApiDefinition.cs index df4e1a1..6428525 100644 --- a/NewRelic.MAUI.iOS.Binding/ApiDefinition.cs +++ b/NewRelic.MAUI.iOS.Binding/ApiDefinition.cs @@ -80,7 +80,7 @@ #if !NET using NativeHandle = System.IntPtr; #endif -namespace iOS.NewRelic +namespace MauiiOS.NewRelic { diff --git a/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj b/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj index 719e4b8..ab0ec22 100644 --- a/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj +++ b/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj @@ -6,7 +6,7 @@ true NewRelic.MAUI.iOS.Binding New Relic - 7.5.1 + 7.5.1.1 true NewRelic iOS SDK binding for .NET MAUI A .NET iOS library that binds the native New Relic iOS SDK. With NewRelic, you can collect crashes, network traffic, and other information for .NET MAUI iOS apps using native components. diff --git a/NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs b/NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs index fece323..bd7c400 100644 --- a/NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs +++ b/NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs @@ -8,7 +8,7 @@ using CoreFoundation; using ObjCRuntime; -namespace iOS.NewRelic +namespace MauiiOS.NewRelic { [Flags] public enum NRMAFeatureFlags : ulong From a01beabdc44b06ba9a459345225d474a9b0c0f92 Mon Sep 17 00:00:00 2001 From: ndesai Date: Fri, 27 Sep 2024 10:34:53 -0500 Subject: [PATCH 2/2] fix: added missing info.plist file in iOS bindings --- .../NewRelic.MAUI.Plugin.csproj | 4 ++-- .../Android/NewRelicMethodsImplementation.cs | 4 +++- .../iOS/NewRelicMethodsImplementation.cs | 2 +- .../NewRelic.MAUI.iOS.Binding.csproj | 2 +- .../ios-arm64/NewRelic.framework/Info.plist | Bin 787 -> 749 bytes .../NewRelic.framework/Info.plist | Bin 769 -> 729 bytes 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj b/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj index ee5cfa2..3514df6 100644 --- a/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj +++ b/NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj @@ -8,7 +8,7 @@ true enable NewRelic.MAUI.Plugin - 1.1.2 + 1.1.3 New Relic Plugin for .NET MAUI mobile apps With the New Relic .NET MAUI mobile plugin, your team can monitor the performance of .NET MAUI apps and identify code errors. The plugin collects crash data, network traffic, and other information for your apps using native components. New Relic @@ -35,6 +35,6 @@ - + \ No newline at end of file diff --git a/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs b/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs index d1956df..283f353 100644 --- a/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs +++ b/NewRelic.MAUI.Plugin/Platforms/Android/NewRelicMethodsImplementation.cs @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +using System.Reflection; using Android.Runtime; using Com.Newrelic.Agent.Android.Logging; using NRAndroidAgent = Com.Newrelic.Agent.Android.NewRelic; @@ -69,6 +70,7 @@ private bool IsNumeric(Object obj) public void Start(string applicationToken, AgentStartConfiguration agentConfig = null) { + if (agentConfig == null) { agentConfig = new AgentStartConfiguration(); @@ -126,7 +128,7 @@ public void Start(string applicationToken, AgentStartConfiguration agentConfig = var newRelic = NRAndroidAgent.WithApplicationToken(applicationToken) - .WithApplicationFramework(Com.Newrelic.Agent.Android.ApplicationFramework.Maui, "1.1.2") + .WithApplicationFramework(Com.Newrelic.Agent.Android.ApplicationFramework.Maui, "1.1.3") .WithLoggingEnabled(agentConfig.loggingEnabled) .WithLogLevel(logLevelDict[agentConfig.logLevel]); diff --git a/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs b/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs index 7e916af..7255993 100644 --- a/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs +++ b/NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs @@ -52,7 +52,7 @@ public void Start(string applicationToken, AgentStartConfiguration agentConfig = NRIosAgent.EnableCrashReporting(agentConfig.crashReportingEnabled); NRIosAgent.SetPlatform(MauiiOS.NewRelic.NRMAApplicationPlatform.Maui); - MauiiOS.NewRelic.NewRelic.SetPlatformVersion("1.1.2"); + MauiiOS.NewRelic.NewRelic.SetPlatformVersion("1.1.3"); MauiiOS.NewRelic.NRLogger.SetLogLevels((uint)logLevelDict[agentConfig.logLevel]); if (!agentConfig.loggingEnabled) diff --git a/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj b/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj index ab0ec22..7627e22 100644 --- a/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj +++ b/NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj @@ -6,7 +6,7 @@ true NewRelic.MAUI.iOS.Binding New Relic - 7.5.1.1 + 7.5.1.2 true NewRelic iOS SDK binding for .NET MAUI A .NET iOS library that binds the native New Relic iOS SDK. With NewRelic, you can collect crashes, network traffic, and other information for .NET MAUI iOS apps using native components. diff --git a/NewRelic.MAUI.iOS.Binding/NewRelic.xcframework/ios-arm64/NewRelic.framework/Info.plist b/NewRelic.MAUI.iOS.Binding/NewRelic.xcframework/ios-arm64/NewRelic.framework/Info.plist index 4015d521c0cc15ac4f4e622688ba1277ba03b26c..57ea048459138ad6da4a4c8d5a9036a201a58865 100644 GIT binary patch delta 114 zcmV-&0FD2X2JHnEVsLC}b968;-w+i60s{mE1_uZU3b7aM0Rf?t2LfYBq9`d40T2SA zD^+1~Z8kIj2mmzzO8{p8d;pOEu>igR)By1T4gnwmD*-(LOaWj4YXNlueF2IAodK)? U%K_2>)dAiC^8xn({FBuJK4P67-T(jq delta 152 zcmaFMI+;y8sURn_xWvHV{rjWg7!??`8EqMT7!w$?8A};!8G)*Z!IRfB*#Q7u C4?a5p diff --git a/NewRelic.MAUI.iOS.Binding/NewRelic.xcframework/ios-arm64_x86_64-simulator/NewRelic.framework/Info.plist b/NewRelic.MAUI.iOS.Binding/NewRelic.xcframework/ios-arm64_x86_64-simulator/NewRelic.framework/Info.plist index 10febfc7fdc197d8d9f92c759e0b67d7c853eea2..24406f5cd7ed61498c0fc5247d42a01fa785f5d7 100644 GIT binary patch delta 113 zcmV-%0FM8G2H6D|VsLC}b968;-w+f50s{mE1_uZU3JVMku^Pz%0il!T0e(fICnyjB z5CQ-Q05bqd0A&Dr0FMB#0K5Rw0Pg_|0UiM<0XqRo0bT)V0doO+0f+&c0jdG90ki?V T0n!210owuL0pkJnlg$D&0}&n5 delta 175 zcmcb~+Q=rARFIQdTw-AGe*azp5k@9v7FITP4o)s^9