iOS push callback is invoked twice

  • 28 April 2019
  • 3 replies


I added Mixpanel SDK to my iOS app as described in your documentation.

Everything is working fine, I can track events. But we have one issue:

Our app uses iOS Push notifications - and when Mixpanel SDK enabled - push callback is invoked twice


func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {)

If I disable Mixpanel SDK - it works fine.

I see in backtrace that your SDK uses swizzling for this callback - maybe that's the isse?

Can you please help me resolve this issue?

3 replies

Userlevel 3

@HipWig -

What is the main issue that you are seeing? Is it that push notifications are not getting delivered? Are you using Mixpanel Push Notifications or a different service?

Mixpanel swizzles when tracking push opens. So if you want to prevent push open tracking at initialization as seen here (Obj-C, Swift), you can include the following configuration:

Mixpanel.sharedInstance(withToken:@"API Token",
                                       automaticPushTracking: false)


the main issue that if i enable Mixpanel SDK - standart iOS callback for handling pushes invoking twice every time (instead of one). Thats all

1) i use different service for pushes (dedicated backend interact with APNS directly) - so i don't use mixpanel pushes, only event tracking
2) I will try your code and reply a little later

UPD: seems like it working normally now (I added your line of code), thanks

Userlevel 3

Great to hear!