Integrate nGrow thru Firebase SDK

Android

Firebase Push SDK

  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.

  3. Create and send a server key from the Firebase interface:

Firebase Analytics SDK (via BigQuery)

  1. Implement Firebase Core SDK according to this instruction.

  2. Implement logging the custom event push_token with custom event properties following this instruction.

    a. There is a bit tricky part with sending push tokens (aka registration id in Firebase). The thing is that there is a limit of 100 characters for any string event property, but the registration id length is ~163 chars. So we suggest splitting the registration id into two strings of 100 chars and the rest respectively, and sending them in two event properties push_token_0 and push_token_1 within the same event.

    b. So the final setup of the event would be:

event_name: push_token
event_properties:
    push_token_0: “fVB5-GsfONYTmjsOX6POeS:APA91bGOokpBTI_aAO_JybIMfJ8WCPX_77EWVqzOlmsTm6GaUngqRf-hu_ZMXS9JptSOqBJ0YxOG”,
    push_token_1: “IhnUwZAetYELraJkvzGOJxQCksefcJLsg_1zPi7LYKWqfQ35qLc2CNwb6TFddGv9”
  1. For triggering the event logging, you can use callback onNewToken of Firebase SDK. Alternatively, it is also an option to check token changes on your own on each app start, and trigger the event logging in case of a change.

  2. Make sure that you have linked Firebase and BigQuery according to this instruction.

  3. Provide nGrow.ai access to the BigQuery interface for a relevant project. To do that, add a new user [email protected] to your Google Cloud platform with the roles BigQuery User, BigQuery Data Viewer

Additionally, create a service account with the same BigQuery User, BigQuery Data Viewer roles, and send us the resulting .json file

iOS

Firebase Push SDK

  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.

  4. Create and send a server key from the Firebase interface:

Firebase Analytics SDK (via BigQuery)

  1. Implement logging the custom event push_token with custom event properties following this instruction.

    a. There is a bit tricky part with sending push tokens (aka registration id in Firebase). The thing is that there is a limit of 100 characters for any string event property. But the registration id length is ~163 chars. So we suggest splitting the registration id into two strings of 100 chars and the rest respectively, and sending them in two event properties push_token_0 and push_token_1 within the same event.

    b. It is extremely important to send both of these event properties within the same event. So the final setup of the event would be:

event_name: "push_token"
event_properties:
    push_token_0: "fVB5-GsfONYTmjsOX6POeS:APA91bGOokpBTI_aAO_JybIMfJ8WCPX_77EWVqzOlmsTm6GaUngqRf-hu_ZMXS9JptSOqBJ0YxOG"
    push_token_1: "IhnUwZAetYELraJkvzGOJxQCksefcJLsg_1zPi7LYKWqfQ35qLc2CNwb6TFddGv9"
  1. For triggering the event logging, you can use token refresh monitoring. Alternatively, it is also an option to check token changes on your own on each app start, and trigger the event logging in case of a change.

  2. Make sure that you have linked Firebase and BigQuery according to this instruction.

  3. Provide nGrow.ai access to the BigQuery interface for a relevant project. To do that, add a new user [email protected] to your Google Cloud platform with the roles BigQuery User, BigQuery Data Viewer

  1. Additionally, create a service account with the same BigQuery User, BigQuery Data Viewer roles, and send us the resulting .json file

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 page help you?