开发者

Updated google anaytics binding?

I'm having a hard time using the newest google analytics piece with the MonoTouch bindings that Miguel has here: https://github.com/migueldeicaza/monotouch-libs/tree/master/GoogleAnalytics

I'm guessing that the interface has changed a bit in ways that are incompatible, but I'm not sure how to diagnose. At run time, I get this error: System.InvalidCastException: Cannot cast from source type to destination type. at GoogleAnalytics.GANTracker.get_SharedTracker () [0x00000] in :0

It appears that only two methods were added, so I att开发者_运维百科empted to add these to "api.cs" - but got a series of compiler errors that didn't seem to tie into the situation.

    [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);   

Has anyone else overcome this, and is successfully using the NoThumb version of google analytics with MonoTouch ?


I had the same issue, but I got it to work eventually.

I had to use the btouch tool, on the latest version of Google Analytics for iOS. This recreated the GANTracker.dll.

I also added this to my project file under iPhone Build->Additional mtouch Args:

-v -v -v -gcc_flags "-L${ProjectDir}/Google -lGoogleAnalytics -lsqlite3.0 -force_load ${ProjectDir}/Google/libGoogleAnalytics.a"

I have a Google subfolder in my project with these files:

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

Sorry, I don't have more specific instructions on btouch, it's been a while.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜