Closed jonatansberg closed 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.
- (void)application: didRegisterForRemoteNotificationsWithDeviceToken:
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.
Nice, do you have time to implement this or should I give it a try?
@wienke Wy don't you go ahead and give it a shot? I'll what I can do about #3 next week.
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:
See previous discussion in #1 and https://github.com/mixpanel/mixpanel-iphone/blob/master/Mixpanel/Mixpanel.m#L1430.