Skip to content

Commit

Permalink
fix:iOS namespace issue #45
Browse files Browse the repository at this point in the history
  • Loading branch information
ndesai-newrelic committed Sep 23, 2024
1 parent 1a04cd8 commit d2af693
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions NewRelic.MAUI.Plugin/NewRelic.MAUI.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>NewRelic.MAUI.Plugin</PackageId>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
<Summary>New Relic Plugin for .NET MAUI mobile apps</Summary>
<Description>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.</Description>
<Authors>New Relic</Authors>
Expand All @@ -35,6 +35,6 @@
<PackageReference Include="NewRelic.MAUI.Android.Binding" Version="7.5.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="NewRelic.MAUI.iOS.Binding" Version="7.5.1" />
<PackageReference Include="NewRelic.MAUI.iOS.Binding" Version="7.5.1.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
70 changes: 35 additions & 35 deletions NewRelic.MAUI.Plugin/Platforms/iOS/NewRelicMethodsImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using Foundation;
using System.Diagnostics;
using NRIosAgent = iOS.NewRelic.NewRelic;
using NRIosAgent = MauiiOS.NewRelic.NewRelic;

namespace NewRelic.MAUI.Plugin;

Expand All @@ -14,24 +14,24 @@ public class NewRelicMethodsImplementation : INewRelicMethods
{
private bool _isUncaughtExceptionHandled;

private Dictionary<LogLevel, iOS.NewRelic.NRLogLevels> logLevelDict = new Dictionary<LogLevel, iOS.NewRelic.NRLogLevels>()
private Dictionary<LogLevel, MauiiOS.NewRelic.NRLogLevels> logLevelDict = new Dictionary<LogLevel, MauiiOS.NewRelic.NRLogLevels>()
{
{ 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<NetworkFailure, nint> networkFailureDict = new Dictionary<NetworkFailure, nint>()
{
{ 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<MetricUnit, string> metricUnitDict = new Dictionary<MetricUnit, string>()
Expand All @@ -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);
}


Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion NewRelic.MAUI.iOS.Binding/ApiDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
#if !NET
using NativeHandle = System.IntPtr;
#endif
namespace iOS.NewRelic
namespace MauiiOS.NewRelic
{


Expand Down
2 changes: 1 addition & 1 deletion NewRelic.MAUI.iOS.Binding/NewRelic.MAUI.iOS.Binding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>true</ImplicitUsings>
<PackageId>NewRelic.MAUI.iOS.Binding</PackageId>
<Authors>New Relic</Authors>
<Version>7.5.1</Version>
<Version>7.5.1.1</Version>
<IsBindingProject>true</IsBindingProject>
<summary>NewRelic iOS SDK binding for .NET MAUI</summary>
<description>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.</description>
Expand Down
2 changes: 1 addition & 1 deletion NewRelic.MAUI.iOS.Binding/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using CoreFoundation;
using ObjCRuntime;

namespace iOS.NewRelic
namespace MauiiOS.NewRelic
{
[Flags]
public enum NRMAFeatureFlags : ulong
Expand Down

0 comments on commit d2af693

Please sign in to comment.