hyperlab / TiMixpanel

Mixpanel integration for Titanium Mobile
22 stars 12 forks source link

Fixed Android push notifications and added releases #8

Closed timanrebel closed 10 years ago

timanrebel commented 10 years ago

Registration of Android GCM was not working. Updated code and README documentation

jonatansberg commented 10 years ago

Great! :D

Question: Why not keep the name of addPushDeviceToken and the signature of initWithToken the same, for platform parity?

timanrebel commented 10 years ago

Because the 2 situations are different.

On iOS you get a device token from iOS, which you give to MixPanel by calling addPushDeviceToken, after you have registered for Push Notifications.

On Android you have to give your Google sender id (a kind of API key) to MixPanel by calling initPushHandling, so MixPanel can register for Push Notifications and handle the rest.

addPushDeviceToken is still present in the Android version of the module for parity, but only outputs a debug line in the log.

timanrebel commented 10 years ago

This difference got me confused and was why it was not working. I was sending the Android device token after registering with GCM to MixPanel, instead of handing them my sender id, so they could do it for me

jonatansberg commented 10 years ago

Okay, now I'm with you.

I think I'd still prefer to see initWithToken untouched though, since push registration calls should be made after any additional identify-calls.

jonatansberg commented 10 years ago

Also, some change log entries would be great! (:

timanrebel commented 10 years ago

Here you go

jonatansberg commented 10 years ago

Awesome! Great that you updated the example file. Add the new binary as well and I'll pull. (:

jonatansberg commented 10 years ago

Thank you! :D