更新了谷歌分析绑定?

时间:2011-03-17 15:47:15

标签: xamarin.ios

我很难使用最新的谷歌分析片与Miguel在这里的MonoTouch绑定:https://github.com/migueldeicaza/monotouch-libs/tree/master/GoogleAnalytics

我猜测界面的改变方式有些不相容,但我不确定如何诊断。在运行时,我收到此错误:System.InvalidCastException:无法从源类型转换为目标类型。   在GoogleAnalytics.GANTracker.get_SharedTracker()[0x00000]中:0

似乎只添加了两个方法,所以我尝试将这些方法添加到“api.cs” - 但是得到了一系列似乎与情况无关的编译器错误。

    [Export ("setCustomVariableAtIndex:index:name:value:scope:error"),Internal]
    bool _SetCustomVariableAtIndex(int index, string name, string value, int scope, IntPtr nsErrorPtr);                       

    [Export ("setCustomVariableAtIndex:index:name:value:error"),Internal]
    bool _SetCustomVariableAtIndex(int index, string name, string value, IntPtr nsErrorPtr);   

是否还有其他人克服了这一点,并成功将NoThumb版本的谷歌分析与MonoTouch一起使用?

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,但我最终还是开始工作了。

我必须在btouch的最新版本上使用Google Analytics for iOS工具。这重新创建了GANTracker.dll。

我还在iPhone Build->附加mtouch Args:

下将其添加到我的项目文件中
-v -v -v -gcc_flags "-L${ProjectDir}/Google -lGoogleAnalytics -lsqlite3.0 -force_load ${ProjectDir}/Google/libGoogleAnalytics.a"

我的项目中有一个包含这些文件的Google子文件夹:

  • GANTracker.dll
  • GANTracker.h
  • libGoogleAnalytics.a

抱歉,我没有更多关于btouch的具体说明,已经有一段时间了。