This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the google analytics binding. Added a sample.
- Loading branch information
Showing
12 changed files
with
198 additions
and
26 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using MonoTouch.ObjCRuntime; | ||
|
||
[assembly: LinkWith ("libFixedGoogleAnalytics.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, "-lsqlite3.0", Frameworks = "CFNetwork", ForceLoad = true)] | ||
[assembly: LinkWith ("libGoogleAnalytics.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, "-lsqlite3.0", Frameworks = "CFNetwork", ForceLoad = true)] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// This shows the various capabilities of the | ||
// AtmHud library | ||
// | ||
using System; | ||
using MonoTouch.Foundation; | ||
using MonoTouch.UIKit; | ||
using System.Drawing; | ||
using MonoTouch.Dialog; | ||
|
||
namespace sample | ||
{ | ||
[Register ("AppDelegate")] | ||
public partial class AppDelegate : UIApplicationDelegate | ||
{ | ||
UIWindow window; | ||
const string account = "UA-27277921-1"; | ||
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) | ||
{ | ||
GoogleAnalytics.GANTracker.SharedTracker.StartTracker(account,60,null); | ||
window = new UIWindow (UIScreen.MainScreen.Bounds); | ||
window.RootViewController = new DialogViewController(CreateRoot()); | ||
window.MakeKeyAndVisible (); | ||
|
||
return true; | ||
} | ||
|
||
static void Main (string[] args) | ||
{ | ||
// if you want to use a different Application Delegate class from "AppDelegate" | ||
// you can specify it here. | ||
UIApplication.Main (args, null, "AppDelegate"); | ||
} | ||
public RootElement CreateRoot() | ||
{ | ||
return new RootElement("Google Analytics") | ||
{ | ||
new Section() | ||
{ | ||
new StringElement("Track Event",delegate{ | ||
NSError error; | ||
var success = GoogleAnalytics.GANTracker.SharedTracker.TrackEvent("Sample Data","Button Clicked","Xamarin!",1,out error); | ||
Console.WriteLine(error); | ||
ShowMessage(success ? "Success" : "Error",error == null ? "" : error.ToString()); | ||
}), | ||
new StringElement("Track Page",delegate{ | ||
NSError error; | ||
var success = GoogleAnalytics.GANTracker.SharedTracker.TrackPageView("HomePage",out error); | ||
Console.WriteLine(error); | ||
ShowMessage(success ? "Success" : "Error",error == null ? "" : error.ToString()); | ||
}), | ||
new StringElement("Set Custom Variable",delegate{ | ||
NSError error; | ||
var success = GoogleAnalytics.GANTracker.SharedTracker.SetCustomVariable(0,"Version",UIDevice.CurrentDevice.SystemVersion,out error); | ||
Console.WriteLine(error); | ||
ShowMessage(success ? "Success" : "Error",error == null ? "" : error.ToString()); | ||
}), | ||
} | ||
}; | ||
} | ||
public void ShowMessage(string title,string message) | ||
{ | ||
var alert = new UIAlertView(title,message,null,"OK"); | ||
alert.Show(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>UIDeviceFamily</key> | ||
<array> | ||
<integer>1</integer> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> | ||
<ProductVersion>10.0.0</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}</ProjectGuid> | ||
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>sample</RootNamespace> | ||
<AssemblyName>sample</AssemblyName> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<MtouchDebug>true</MtouchDebug> | ||
<MtouchProfiling>true</MtouchProfiling> | ||
<MtouchLink>None</MtouchLink> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> | ||
<DebugType>none</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<MtouchLink>None</MtouchLink> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\iPhone\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<CodesignKey>iPhone Developer</CodesignKey> | ||
<MtouchDebug>true</MtouchDebug> | ||
<MtouchProfiling>true</MtouchProfiling> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> | ||
<DebugType>none</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\iPhone\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<CodesignKey>iPhone Developer</CodesignKey> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="monotouch" /> | ||
<Reference Include="GoogleAnalytics"> | ||
<HintPath>..\binaries\GoogleAnalytics.dll</HintPath> | ||
</Reference> | ||
<Reference Include="MonoTouch.Dialog-1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Info.plist" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AppDelegate.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sample", "sample.csproj", "{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|iPhoneSimulator = Debug|iPhoneSimulator | ||
Release|iPhoneSimulator = Release|iPhoneSimulator | ||
Debug|iPhone = Debug|iPhone | ||
Release|iPhone = Release|iPhone | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Debug|iPhone.ActiveCfg = Debug|iPhone | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Debug|iPhone.Build.0 = Debug|iPhone | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Release|iPhone.ActiveCfg = Release|iPhone | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Release|iPhone.Build.0 = Release|iPhone | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator | ||
{01A89D4F-C7DF-4B7E-BC28-F86F5BC9E30A}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator | ||
EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | ||
StartupItem = sample.csproj | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters