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

Firebase (Notification Service)

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

  2. Pay your attention and implement the first three paragraphs of this part of the instruction (in case you disable the method swizzling, the paragraph about disabled method swizzling is also mandatory).

  3. Make sure that the app resolves images in push notifications.

Mixpanel (Integrate Analytics)

  1. Implement sending event in Mixpanel:

    If using the Firebase Push SDK you need to send registration_id instead of push_token .

    The event can be sent using Firebase SDK token refresh monitoring.

    Alternatively, you can independently check if the token has changed each time the application is launched, and send events if it has changed.

    NOTE. In case you use Firebase Push SDK, make sure that you send Firebase registration id (which is also referred to as fcmToken in code examples). Do not confuse it with the APNS push token. The one we need looks like this:

    fVB5-GsfONYTmjsOX6POeS:APA91bGOokpBTI_aAO_JybIMfJ8WCPX_77EWVqzOlmsTm6GaUngqRf-hu_ZMXS9JptSOqBJ0YxOGIhnUwZAetYELraJkvzGOJxQCksefcJLsg_1zPi7LYKWqfQ35qLc2CNwb6TFddGv9

Did this answer your question?