Goals

The goal of this guide is to set up:

  • basic push notifications handling via Firebase Cloud Messaging SDK

  • sending registration_id (push_token in Firebase Cloud Messaging system) to the Mixpanel system

Android:

Firebase (Notification Service)

  1. Make sure that you’ve implemented Firebase Cloud Messaging SDK according to this instruction.

  2. Pay your attention to the first two paragraphs of this part of the instruction. The third paragraph is optional.

Mixpanel (Integrate Analytics)

  1. Implement sending events in Mixpanel: you need to send a push_token event with an event property token, in which the device token from Firebase is passed.

    The event can be dispatched using the [onNewToken callback](https://firebase.google.com/docs/cloud-messaging/android/client#monitor-token-generation) in the Firebase SDK.

    Alternatively, you can independently check if the token changes every time the application is applied, and send events if it changes.

Did this answer your question?