Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Xamarin Unified API #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AnalyticsEngine.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.IO.IsolatedStorage;
using System.IO.IsolatedStorage;
using System.Windows;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
using System.Threading.Tasks;

namespace GoogleAnalytics
Expand Down
6 changes: 3 additions & 3 deletions EasyTracker.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
using System.Windows;
using System.Xml;
using MonoTouch.UIKit;
using UIKit;
using System.IO;
using MonoTouch.Foundation;
using Foundation;
using System.Reflection;

namespace GoogleAnalytics
Expand Down
2 changes: 1 addition & 1 deletion GoogleAnalytics.Common/AnalyticsEngine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

Expand Down
4 changes: 2 additions & 2 deletions GoogleAnalytics.Common/EasyTracker.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System;
using System.Xml;
using MonoTouch.UIKit;
using UIKit;
using System.Windows;
using System.Threading.Tasks;

Expand Down
2 changes: 1 addition & 1 deletion GoogleAnalytics.Common/EasyTrackerConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
4 changes: 2 additions & 2 deletions GoogleAnalytics.Common/GAServiceManager.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Threading;
using System.Net.Http;
using MonoTouch.UIKit;
using UIKit;


#if NETFX_CORE
Expand Down
2 changes: 1 addition & 1 deletion GoogleAnalytics.Common/Payload.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;

namespace GoogleAnalytics
Expand Down
8 changes: 4 additions & 4 deletions GoogleAnalytics.Common/PayloadFactory.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Drawing;
using CoreGraphics;


#if NETFX_CORE
Expand Down Expand Up @@ -30,14 +30,14 @@ internal sealed class PayloadFactory
public bool AnonymizeIP { get; set; }
public IDictionary<int, string> CustomDimensions { get; set; }
public IDictionary<int, int> CustomMetrics { get; set; }
public Size? ViewportSize { get; set; }
public CGSize? ViewportSize { get; set; }
// TODO: unused
public string Referrer { get; set; }
public string Campaign { get; set; }
public string ScreenName { get; set; }

public string AnonymousClientId { get; set; }
public Size? ScreenResolution { get; set; }
public CGSize? ScreenResolution { get; set; }
public string UserLanguage { get; set; }
public int? ScreenColorDepthBits { get; set; }
public string DocumentEncoding { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion GoogleAnalytics.Common/TokenBucket.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace GoogleAnalytics
{
Expand Down
6 changes: 3 additions & 3 deletions GoogleAnalytics.Common/Tracker.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using CoreGraphics;


#if NETFX_CORE
Expand Down Expand Up @@ -89,7 +89,7 @@ public string AppVersion
set { engine.AppVersion = value; }
}

public Size? AppScreen
public CGSize? AppScreen
{
get { return engine.ViewportSize; }
set { engine.ViewportSize = value; }
Expand Down
2 changes: 1 addition & 1 deletion GoogleAnalytics.Common/Transactions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace GoogleAnalytics
{
Expand Down
12 changes: 9 additions & 3 deletions GoogleAnalytics.Tests/GoogleAnalytics.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{680B48B2-F12B-44A7-BD6A-74AFCA5CE09C}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>GoogleAnalytics.Tests</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>GoogleAnalyticsTests</AssemblyName>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -44,6 +46,7 @@
<MtouchDebug>true</MtouchDebug>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchArch>ARMv7</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>full</DebugType>
Expand All @@ -53,6 +56,7 @@
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>full</DebugType>
Expand All @@ -64,6 +68,7 @@
<BuildIpa>true</BuildIpa>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>full</DebugType>
Expand All @@ -74,13 +79,14 @@
<CodesignKey>iPhone Distribution</CodesignKey>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="MonoTouch.NUnitLite" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
Expand All @@ -93,7 +99,6 @@
<Compile Include="UnitTestAppDelegate.cs" />
<Compile Include="TrackerTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\GoogleAnalytics.csproj">
<Project>{C82BF345-37AC-42E8-A489-204923D291CC}</Project>
Expand All @@ -103,4 +108,5 @@
<ItemGroup>
<Content Include="analytics.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
4 changes: 2 additions & 2 deletions GoogleAnalytics.Tests/Main.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;

namespace GoogleAnalytics.Tests
{
Expand Down
6 changes: 3 additions & 3 deletions GoogleAnalytics.Tests/TrackerTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using System.Drawing;
using MonoTouch.UIKit;
using CoreGraphics;
using UIKit;

namespace GoogleAnalytics.Tests
{
Expand Down Expand Up @@ -33,7 +33,7 @@ public void config_app_name()
public void config_screen_information()
{
var tracker = GoogleAnalytics.EasyTracker.GetTracker();
Assert.AreEqual(tracker.AppScreen.Value, new Size((int)UIScreen.MainScreen.Bounds.Width, (int) UIScreen.MainScreen.Bounds.Height));
Assert.AreEqual(tracker.AppScreen.Value, new CGSize((int)UIScreen.MainScreen.Bounds.Width, (int) UIScreen.MainScreen.Bounds.Height));
}
}
}
4 changes: 2 additions & 2 deletions GoogleAnalytics.Tests/UnitTestAppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
using MonoTouch.NUnit.UI;

namespace GoogleAnalytics.Tests
Expand Down
8 changes: 5 additions & 3 deletions GoogleAnalytics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C82BF345-37AC-42E8-A489-204923D291CC}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>GoogleAnalytics</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>GoogleAnalytics</AssemblyName>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -34,8 +36,8 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="System.Net.Http" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
Expand Down Expand Up @@ -79,5 +81,5 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reachability .cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
16 changes: 8 additions & 8 deletions PlatformInfoProvider.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System;
using System.IO.IsolatedStorage;
using System.Windows;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using CoreGraphics;
using Foundation;
using UIKit;

namespace GoogleAnalytics
{
Expand Down Expand Up @@ -33,14 +33,14 @@ public string AnonymousClientId
}
}

public Size? ScreenResolution
public CGSize? ScreenResolution
{
get { return new Size((int)UIScreen.MainScreen.Bounds.Width, (int) UIScreen.MainScreen.Bounds.Height); }
get { return new CGSize((int)UIScreen.MainScreen.Bounds.Width, (int) UIScreen.MainScreen.Bounds.Height); }
}

public Size? ViewPortResolution
public CGSize? ViewPortResolution
{
get { return new Size((int)UIScreen.MainScreen.Bounds.Width, (int)UIScreen.MainScreen.Bounds.Height); }
get { return new CGSize((int)UIScreen.MainScreen.Bounds.Width, (int)UIScreen.MainScreen.Bounds.Height); }
}

public string UserLanguage
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
Expand Down
2 changes: 1 addition & 1 deletion Reachability .cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using MonoTouch.SystemConfiguration;
using SystemConfiguration;
using System.Threading.Tasks;

namespace GoogleAnalytics
Expand Down