mils
mils

Reputation: 1916

Mixpanel - iOS Push Notifications - Remove Single Token

I am using Mixpanel tracking in an iOS project. I can successfully send Mixpanel push notifications to many iOS clients. However, when a client logs out of my app, I no longer wish for them to receive Mixpanel push notifications.

In Mixpanel I can register many device tokens for one user with the function call

-addPushDeviceToken:

However, from what I can see, I cannot unregister a single token for a given user. The closest function I have found is:

-removePushDeviceToken

However this function will obliterate all device tokens for a given user.

The same is true for the Mixpanel web API - namely the function $unset will obliterate the entire property.

How can I handle users logging out of my app on one device without affecting Mixpanel push notifications on their remaining devices?

Thanks,

Upvotes: 2

Views: 589

Answers (1)

Harold BOULEY
Harold BOULEY

Reputation: 248

Update 9/12: as of Mixpanel 3.0.3 the function is now implemented!

Mixpanel.mainInstance().people.addPushDeviceToken(tokenData)

Mixpanel.mainInstance().people.removePushDeviceToken(tokenData)

Mixpanel currently doesn't provide a way to remove a specific token. It has been discussed on their github as an issue, so I guess what you (and I) can do is to check periodically if they update it.

See https://github.com/mixpanel/mixpanel-iphone/issues/164 and https://github.com/mixpanel/mixpanel-iphone/pull/419

Upvotes: 4

Related Questions