SempaiGames / haxe-ga

GoogleAnalytics Client API port to Haxe
Other
60 stars 23 forks source link

Newest Version Breaks in Flash #5

Closed francoisvn closed 10 years ago

francoisvn commented 10 years ago

The change from 0.4.6 to 0.4.7 broke a project I'm working on, but only with the flash target. The project uses OpenFL and everything is updated.

I had a look, and the problem seems to be on line 166 of "googleAnalytics/internals/request/Request.hx":

urlRequest.requestHeaders.push(new flash.net.URLRequestHeader('User-Agent', userAgent));

Removing just this line fixes the problem for me, but obviously changes functionality. I had a look and I'm not sure why there is a problem with that line. Wrapping the line in a try-catch statement doesn't seem to catch anything (with "catch (e:Dynamic)").

fbricker commented 10 years ago

Mmm... I made some tests and you're right. I've removed that line for flash target (as Flash overrides user-agent anyway). You can now do haxelib upgrade to get version 0.4.8

Thanks for advising! Federico

francoisvn commented 10 years ago

Thank you :)