hyperlab / TiMixpanel

Mixpanel integration for Titanium Mobile
22 stars 12 forks source link

Add support for APNS #2

Closed jonatansberg closed 10 years ago

jonatansberg commented 10 years ago

We cannot access the required raw NSData passed to - (void)application: didRegisterForRemoteNotificationsWithDeviceToken:, however adding the token as a hex string to an existing user profile should still be possible.

Untested proof of concept:

- (void)profileAddDevice:(id)token
{
    ENSURE_STRING(token);
    NSArray *tokens = @[[NSString stringWithString:token]];
    NSDictionary *properties = @{@"$ios_devices": tokens};
    [[Mixpanel sharedInstance].people union:properties];
}

See previous discussion in #1 and https://github.com/mixpanel/mixpanel-iphone/blob/master/Mixpanel/Mixpanel.m#L1430.

wienke commented 10 years ago

Nice, do you have time to implement this or should I give it a try?

jonatansberg commented 10 years ago

@wienke Wy don't you go ahead and give it a shot? I'll what I can do about #3 next week.