hyperlab / TiMixpanel

Mixpanel integration for Titanium Mobile
22 stars 12 forks source link

Alias not working on android #10

Closed alvesl closed 10 years ago

alvesl commented 10 years ago

Hello,

Thanks for the great project. Upon calling either methods createAlias or createAliasForId (as shown in app.js example) I get the following error: [ERROR] : V8Exception: Exception occurred at alloy/controllers/completeSignup.js:441: Uncaught TypeError: Object # has no method 'createAliasForId' or [ERROR] : V8Exception: Exception occurred at alloy/controllers/completeSignup.js:441: Uncaught TypeError: Object # has no method 'createAlias'

Im running Titanium 3.4.0GA and its an alloy project.

Thanks for your time.

jonatansberg commented 10 years ago

Hi there,

Currently the bundled version of the Mixpanel API (4.0.1) is too old. Support for the alias methods were introduced in the 4.1 release. Unfortunately I don't have the time or the environment set up to fix this at the moment, but I'll leave you with some instructions.

To upgrade the bundled Mixpanel API you would need to:

  1. Install the Mixpanel API and build/extract a new .jar-lib. This is the tricky part if you're not that familiar with Java and/or Gradle.
  2. Drop the lib in place in the project.
  3. Uncomment the createAlias methods.
  4. Rebuild the module.

An thats it! In theory, at least.

If you find the time to do that I'll happily accept any future pull requests :)

alvesl commented 10 years ago

Great, thanks for the quick response. I'll look into it soon, may I leave this open meanwhile?

jonatansberg commented 10 years ago

Yeah, sure!

20 okt 2014 kl. 15:49 skrev Lucas Alves notifications@github.com:

Great, thanks for the quick response. I'll look into it soon, may I leave this open meanwhile?

— Reply to this email directly or view it on GitHub.

jonatansberg commented 10 years ago

@alvesl You could download the .aar-release from here: http://search.maven.org/#artifactdetails%7Ccom.mixpanel.android%7Cmixpanel-android%7C4.4.0%7Caar.asc

It's .zip-file (but with a different extension) containing a prebuilt jar file bundled together with all the other assets. It could probably save you an hour or two :)

jonatansberg commented 10 years ago

Fixed in #11! :smile:

alvesl commented 10 years ago

Awesome! Thanks a lot!