Bug 2062 - Google Analytics
Summary: Google Analytics
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-11-16 15:20 UTC by Hipolyto
Modified: 2011-11-17 12:58 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Xample (5.78 MB, application/zip)
2011-11-16 15:20 UTC, Hipolyto
New xample witch dll bulild (btouch) (259.46 KB, application/zip)
2011-11-16 16:35 UTC, Hipolyto
generated dll (8.50 KB, application/octet-stream)
2011-11-16 17:08 UTC, Sebastien Pouliot

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Hipolyto 2011-11-16 15:20:17 UTC
Created attachment 896 [details]

I'm trying to implement in my application analytisc google and I can not.

Method not found: 'MonoTouch.ObjCRuntime.Messaging.Boolean_objc_msgSend_IntPtr_IntPtr'.

I'm using as a reference this page:
Comment 1 Sebastien Pouliot 2011-11-16 15:45:02 UTC
A few things changed since the above page was published and this page was not yet updated.

You'll need to re-run btouch to get a newer binding assembly. To do so just get the monotouch-libs source code from your link then, from a terminal, do:

cd monotouch-libs/GoogleAnalytics

rm *.dll

/Developer/MonoTouch/usr/bin/btouch -unsafe -out=GANTracker.dll api.cs -x GANTracker.cs

That will create a newer version of GANTracker.dll that you should be able to use without hitting the "Method not found" error. Let us know if this does not work (or simply close the bug report if it solve your issue).
Comment 2 Hipolyto 2011-11-16 16:34:09 UTC
I used btouch and generate the correct dll.

However, the method TrackPageView is not recognized.

Any ideas?
Comment 3 Hipolyto 2011-11-16 16:35:03 UTC
Created attachment 898 [details]
New xample witch dll bulild (btouch)

New xample witch dll bulild (btouch)
Comment 4 Sebastien Pouliot 2011-11-16 16:47:28 UTC
Can you include the exact error you're seeing ? 

I rebuilt the code from your attachment using the .dll I generated [1] and I could compile the application without error. However I do get a NullReferenceException while executing the code - but it looks different than what you got from comment #2.

[1] I could not use your since it was referenced from outside your directory
Comment 5 Hipolyto 2011-11-16 16:48:58 UTC
This is the exact error:

/Users/polo/Projects/iphone/MAC/UvBookingEngineIphone-1/AppGA/DetailViewController.cs(19,19): Error CS1061: Type `GoogleAnalytics.GANTracker' does not contain a definition for `TrackPageView' and no extension method `TrackPageView' of type `GoogleAnalytics.GANTracker' could be found (are you missing a using directive or an assembly reference?) (CS1061) (AppGA)
Comment 6 Sebastien Pouliot 2011-11-16 17:08:24 UTC
Created attachment 899 [details]
generated dll

I attached the .dll I got generated locally.

It's possible some recent change in btouch are not yet available (which version of MonoTouch are you using). Let me know how it turns out.
Comment 7 Hipolyto 2011-11-16 17:19:46 UTC
I am currently using version 5.2.

What version should I use?

Comment 8 Sebastien Pouliot 2011-11-16 17:32:14 UTC
5.2 is not released yet ;-) That's likely 5.0.2 (stable) or 5.1 (beta). Both versions are fine. I think btouch was updated recently for it's "-x" support - which would explain the difference between my and your builds. It makes bindings a bit easier to build in a single step.
Comment 9 Hipolyto 2011-11-16 17:43:33 UTC
You right im using the 5.0.2 Version.

With your dll and gave no errors.

However, the track is not reflected in the Google site analytics

What will be missing me?
Comment 10 Hipolyto 2011-11-16 17:56:12 UTC
It is working.
 this dll you sent me will serve me for a release version?
Comment 11 Sebastien Pouliot 2011-11-16 18:01:41 UTC
Great! I'm glad this works for you with the attached .dll. 

You should be able to use this .dll without any issue (since monotouch.dll did not change between 5.0.2 and what's I'm using wrt Messaging* methods).
Comment 12 Hipolyto 2011-11-17 12:22:30 UTC
Another question, I need to also implement these functions:

Can MonoTouch support this?

Thank you.
Comment 13 Sebastien Pouliot 2011-11-17 12:35:52 UTC
Please do not re-open bug reports unless there is a direct regression on the original issue (e.g. same crash or exception reappearing). Doing so confuse anyone on the bug's c.c. list and if it (really) gets re-opened for a regression later then we won't know if it's the original or additional request(s) have regressed.

Simply open a new bug report and copy-paste your comment #12 inside it :-)
Comment 14 Hipolyto 2011-11-17 12:39:34 UTC
I´m sorry.
Comment 15 Sebastien Pouliot 2011-11-17 12:52:29 UTC
It's no problem :) The main point is having "a single issue per bug report" so we can make sure it's fixed (before closing it) and go back into it if it ever regress (the bug history is more useful if there's a single issue inside it).

From your new bug #2079 it seems this bug was not totally fixed, right ? because I assumed this was working for you based on comment #10.
Comment 16 Sebastien Pouliot 2011-11-17 12:57:29 UTC
Your other bug reports said this occurs on device/release. Does it only happen in this configuration ? or is it the only configuration you tested it under ?
Comment 17 Hipolyto 2011-11-17 12:58:49 UTC
I realized that I had not added the extra arguments to the release mode. :p

-gcc_flags "-L${ProjectDir} -lGoogleAnalytics_NoThumb -lsqlite3.0 -framework CFNetwork -force_load ${ProjectDir}/libGoogleAnalytics_NoThumb.a"

Is no longer crash in the device(release mode)

Thank you,