diff --git a/GoogleAnalytics/binding/googleanalytics.cs b/GoogleAnalytics/binding/ApiDefinition.cs old mode 100755 new mode 100644 similarity index 96% rename from GoogleAnalytics/binding/googleanalytics.cs rename to GoogleAnalytics/binding/ApiDefinition.cs index 1e102cb8..8229ccd9 --- a/GoogleAnalytics/binding/googleanalytics.cs +++ b/GoogleAnalytics/binding/ApiDefinition.cs @@ -16,171 +16,172 @@ interface GAI { [Internal] [Export ("defaultTracker")] IntPtr InternalDefaultTracker { get; set; } - + [Export ("debug")] bool Debug { get; set; } - + [Export ("optOut")] bool OptOut { get; set; } - + [Export ("dispatchInterval")] double DispatchInterval { get; set; } - + [Export ("trackUncaughtExceptions")] bool TrackUncaughtExceptions { get; set; } - + [Static] [Export ("sharedInstance")] GAI SharedInstance { get; } - + [Internal] [Export ("trackerWithTrackingId:")] IntPtr InternalGetTracker (string trackingId); - + [Export ("dispatch")] void Dispatch (); - + } [BaseType (typeof (NSObject))] + [Protocol] interface GAITracker { [Export ("trackingId")] string TrackingId { get; } [Export ("appName")] string AppName { get; set; } - + [Export ("appId")] string AppId { get; set; } - + [Export ("appVersion")] string AppVersion { get; set; } - + [Export ("anonymize")] bool Anonymize { get; set; } [Export ("useHttps")] bool UseHttps { get; set; } - + [Export ("sampleRate")] double SampleRate { get; set; } - + [Export ("clientId")] string ClientId { get; } - + [Export ("appScreen")] string AppScreen { get; set; } - + [Export ("referrerUrl")] string ReferrerUrl { get; set; } - + [Export ("campaignUrl")] string CampaignUrl { get; set; } - + [Export ("sessionStart")] bool SessionStart { get; set; } - + [Export ("sessionTimeout")] double SessionTimeout { get; set; } - + [Export ("trackView")] bool TrackView (); - + [Export ("trackView:")] bool TrackView (string screen); - + [Export ("trackEventWithCategory:withAction:withLabel:withValue:")] bool TrackEvent(string category, string action, string label, NSNumber value); - + [Export ("trackTransaction:")] bool TrackTransaction (GAITransaction transaction); - + [Export ("trackException:withDescription:")] bool TrackException (bool isFatal, string format ); - + [Export ("trackException:withNSException:")] bool TrackException (bool isFatal, NSException exception); - + [Export ("trackException:withNSError:")] bool TrackException (bool isFatal, NSError error); - + [Export ("trackTimingWithCategory:withValue:withName:withLabel:")] bool TrackTiming (string category, double time, string name, string label); - + [Export ("trackSocial:withAction:withTarget:")] bool TrackSocial (string network, string action, string target); - + [Export ("set:value:")] bool Setvalue (string parameterName, string value); - + [Export ("get:")] string Get (string parameterName); - + [Export ("send:params:")] bool Sendparams (string trackType, NSDictionary parameters); - + [Export ("setCustom:dimension:")] bool SetCustom (int index, string dimension); - + [Export ("setCustom:metric:")] bool SetCustom (int index, NSNumber metric); - + [Export ("close")] void Close (); - + } [BaseType (typeof (NSObject))] interface GAITransaction { [Export ("transactionId")] string TransactionId { get; } - + [Export ("affiliation")] string Affiliation { get; } - + [Export ("revenueMicros")] long RevenueMicros { get; set; } - + [Export ("taxMicros")] long TaxMicros { get; set; } - + [Export ("shippingMicros")] long ShippingMicros { get; set; } - + [Export ("items")] GAITransactionItem[] Items { get; } - + [Static] [Export ("transactionWithId:withAffiliation:")] GAITransaction TransactionFrom (string transactionId, string affiliation); - + [Export ("addItem:")] void AddItem (GAITransactionItem item); - + [Export ("addItemWithCode:name:category:priceMicros:quantity:")] void AddItem (string productCode, string productName, string productCategory, long priceMicros, int quantity); - + } [BaseType (typeof (NSObject))] interface GAITransactionItem { [Export ("productCode")] string ProductCode { get; } - + [Export ("productName")] string ProductName { get; set; } - + [Export ("productCategory")] string ProductCategory { get; set; } - + [Export ("priceMicros")] long PriceMicros { get; set; } - + [Export ("quantity")] int Quantity { get; set; } - + [Static] [Export ("itemWithCode:name:category:priceMicros:quantity:")] GAITransactionItem ItemFrom (string productCode, string productName, string productCategory, long priceMicros, int quantity); - + } - + } diff --git a/GoogleAnalytics/binding/AssemblyInfo.cs b/GoogleAnalytics/binding/AssemblyInfo.cs deleted file mode 100644 index 1a1d1b8e..00000000 --- a/GoogleAnalytics/binding/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System; -using MonoTouch.ObjCRuntime; - -[assembly: LinkWith ("libGoogleAnalytics.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, Frameworks = "SystemConfiguration CFNetwork CoreData", ForceLoad = true)] diff --git a/GoogleAnalytics/binding/GoogleAnalytics.csproj b/GoogleAnalytics/binding/GoogleAnalytics.csproj new file mode 100644 index 00000000..f332e529 --- /dev/null +++ b/GoogleAnalytics/binding/GoogleAnalytics.csproj @@ -0,0 +1,58 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {427ECD83-C8EA-4F81-B499-6D07E4EBF026} + {F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + GoogleAnalytics + Resources + GoogleAnalytics + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + true + + + full + true + bin\Release + prompt + 4 + false + true + + + + + + + + + + + + + + + + + + + + + libGoogleAnalytics.a + + + + \ No newline at end of file diff --git a/GoogleAnalytics/binding/GoogleAnalytics.dll b/GoogleAnalytics/binding/GoogleAnalytics.dll deleted file mode 100755 index 7683e328..00000000 Binary files a/GoogleAnalytics/binding/GoogleAnalytics.dll and /dev/null differ diff --git a/GoogleAnalytics/binding/Makefile b/GoogleAnalytics/binding/Makefile index 1079020f..a8d96f89 100755 --- a/GoogleAnalytics/binding/Makefile +++ b/GoogleAnalytics/binding/Makefile @@ -1,13 +1,13 @@ - BUILD_FLAGS=-unsafe -target:library -nowarn:436 -nowarn:219 BTOUCH=/Developer/MonoTouch/usr/bin/btouch SMCS=/Developer/MonoTouch/usr/bin/smcs CLANG=clang -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk +MONOXBUILD=/Library/Frameworks/Mono.framework/Commands/xbuild all: GoogleAnalytics.dll -GoogleAnalyticsiOS.zip: - curl -O http://dl.google.com/dl/gaformobileapps/googleanalyticsios.zip +GoogleAnalyticsiOS_2.0beta4.zip: + curl -O http://dl.google.com/dl/gaformobileapps/GoogleAnalyticsiOS_2.0beta4.zip #STUBS = armv6.o armv7.o i386.o # @@ -21,13 +21,15 @@ GoogleAnalyticsiOS.zip: # clang -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fobjc-abi-version=2 -fobjc-legacy-dispatch -c -arch i386 stub.m -o i386.o -libGoogleAnalytics.a: GoogleAnalyticsiOS.zip - unzip -p $< 'GoogleAnalyticsiOS_2.0beta*/Library/libGoogleAnalytics.a' > $@ +libGoogleAnalytics.a: GoogleAnalyticsiOS_2.0beta4.zip + unzip -p $< 'GoogleAnalyticsiOS_2.0beta4/Library/libGoogleAnalytics.a' > $@ -GoogleAnalytics.dll: Makefile AssemblyInfo.cs googleanalytics.cs enums.cs extras.cs libGoogleAnalytics.a - -mkdir -p ios - $(BTOUCH) --out=$@ -e googleanalytics.cs enums.cs --sourceonly=list --tmpdir=ios - $(SMCS) $(BUILD_FLAGS) -out:$@ @list enums.cs extras.cs AssemblyInfo.cs -r:monotouch.dll -res:libGoogleAnalytics.a,libGoogleAnalytics.a +GoogleAnalytics.dll: Makefile ApiDefinition.cs StructsAndEnums.cs extras.cs libGoogleAnalytics.a + $(MONOXBUILD) /p:Configuration=Release GoogleAnalytics.csproj + cp bin/Release/GoogleAnalytics.dll GoogleAnalytics.dll + #-mkdir -p ios + #$(BTOUCH) --out=$@ -e googleanalytics.cs enums.cs --sourceonly=list --tmpdir=ios + #$(SMCS) $(BUILD_FLAGS) -out:$@ @list enums.cs extras.cs AssemblyInfo.cs -r:monotouch.dll -res:libGoogleAnalytics.a,libGoogleAnalytics.a clean: - -rm -rf list ios *.a *.dll *.o + -rm -rf list ios *.a *.dll *.o *.zip bin/ obj/ diff --git a/GoogleAnalytics/binding/enums.cs b/GoogleAnalytics/binding/StructsAndEnums.cs similarity index 98% rename from GoogleAnalytics/binding/enums.cs rename to GoogleAnalytics/binding/StructsAndEnums.cs index c3a6eeb8..d828cae9 100644 --- a/GoogleAnalytics/binding/enums.cs +++ b/GoogleAnalytics/binding/StructsAndEnums.cs @@ -3,10 +3,10 @@ namespace GoogleAnalytics { public enum GAIErrorCode { // This error code indicates that there was no error. Never used. NoError = 0, - + // This error code indicates that there was a database-related error. DatabaseError, - + // This error code indicates that there was a network-related error. NetworkError, } diff --git a/GoogleAnalytics/binding/extras.cs b/GoogleAnalytics/binding/extras.cs old mode 100755 new mode 100644 diff --git a/GoogleAnalytics/binding/libGoogleAnalytics.linkwith.cs b/GoogleAnalytics/binding/libGoogleAnalytics.linkwith.cs new file mode 100644 index 00000000..3b7ad106 --- /dev/null +++ b/GoogleAnalytics/binding/libGoogleAnalytics.linkwith.cs @@ -0,0 +1,4 @@ +using System; +using MonoTouch.ObjCRuntime; + +[assembly: LinkWith ("libGoogleAnalytics.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, ForceLoad = true, Frameworks = "SystemConfiguration CFNetwork CoreData")] diff --git a/GoogleAnalytics/sample/GoogleAnalyticsSample/AppDelegate.cs b/GoogleAnalytics/samples/GoogleAnalyticsSample/AppDelegate.cs similarity index 100% rename from GoogleAnalytics/sample/GoogleAnalyticsSample/AppDelegate.cs rename to GoogleAnalytics/samples/GoogleAnalyticsSample/AppDelegate.cs diff --git a/GoogleAnalytics/sample/GoogleAnalyticsSample/GoogleAnalyticsSample.sln b/GoogleAnalytics/samples/GoogleAnalyticsSample/GoogleAnalyticsSample.sln similarity index 100% rename from GoogleAnalytics/sample/GoogleAnalyticsSample/GoogleAnalyticsSample.sln rename to GoogleAnalytics/samples/GoogleAnalyticsSample/GoogleAnalyticsSample.sln diff --git a/GoogleAnalytics/sample/GoogleAnalyticsSample/Info.plist b/GoogleAnalytics/samples/GoogleAnalyticsSample/Info.plist similarity index 100% rename from GoogleAnalytics/sample/GoogleAnalyticsSample/Info.plist rename to GoogleAnalytics/samples/GoogleAnalyticsSample/Info.plist diff --git a/GoogleAnalytics/sample/GoogleAnalyticsSample/iOS Sample.csproj b/GoogleAnalytics/samples/GoogleAnalyticsSample/iOS Sample.csproj similarity index 100% rename from GoogleAnalytics/sample/GoogleAnalyticsSample/iOS Sample.csproj rename to GoogleAnalytics/samples/GoogleAnalyticsSample/iOS Sample.csproj diff --git a/GoogleAnalytics/sample/GoogleAnalyticsSample/sample.pidb b/GoogleAnalytics/samples/GoogleAnalyticsSample/sample.pidb similarity index 100% rename from GoogleAnalytics/sample/GoogleAnalyticsSample/sample.pidb rename to GoogleAnalytics/samples/GoogleAnalyticsSample/sample.pidb diff --git a/GoogleAnalytics/samples/Makefile b/GoogleAnalytics/samples/Makefile new file mode 100644 index 00000000..9e4edb61 --- /dev/null +++ b/GoogleAnalytics/samples/Makefile @@ -0,0 +1,11 @@ +#### Sample Builder +#### Author: Alex Soto alex.soto@xamarin.com + +MDTOOL=/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool +PROJECTS=GoogleAnalyticsSample/GoogleAnalyticsSample.sln + +all: + for i in $(PROJECTS); do ($(MDTOOL) build -c:"Release|iPhone" $$i); done + +clean: + for i in $(PROJECTS); do ($(MDTOOL) build -c:"Release|iPhone" -t:Clean $$i); done