TwinrDocs
Push and engagement / Firebase Setup

Firebase Setup

Create a Firebase project and generate the three files Twinr needs for push notifications and analytics.

Push notifications and Firebase Analytics both run on Firebase, Google's app platform. Setting it up means creating one project and generating up to three files from it.

You do this once. The files are shared across features — upload a file under Push and it appears as already uploaded under Analytics, and the other way round.

What you will generate

FilePlatformNeeded for
google-services.jsonAndroidPush notifications, Firebase Analytics
GoogleService-Info.plistiOSPush notifications, Firebase Analytics
Service account keyBothPush campaigns sent from Engage

Google Sign-In does not use these files. It needs three OAuth client IDs from Google Cloud Console instead — see Google Sign-In.

Before you begin

Firebase needs your app's identifiers, and they must match Twinr exactly.

You needWhere to find it
Android package nameSetup Android Signing Information
iOS bundle IDCreate Your Apple Bundle ID

Both look like com.yourcompany.yourapp.

Copy and paste these values — do not type them. Firebase accepts whatever you enter and produces config files that upload without complaint. If the identifier is wrong by a single character, notifications simply never arrive, and nothing anywhere tells you why. This is the most common setup failure.


1. Create a Firebase project

  1. Open the Firebase console

    Go to console.firebase.google.com and sign in with a Google account.

    Use a company account rather than a personal one. This project holds your app's messaging and analytics; if it sits in an individual's account and they leave, recovering it is difficult.

  2. Create the project

    Click Create a project, enter a name — your app's name is the obvious choice — and continue.

  3. Choose whether to enable Google Analytics

    Firebase offers Google Analytics during setup.

    Enable it if you plan to use Firebase Analytics. Skip it if you only want push notifications — you can turn it on later.

  4. Open Project settings

    Once the project is created, click the gear icon beside Project Overview and choose Project settings.

    This is where every file in this guide comes from.


2. Create the Android file

google-services.json connects your Android app to the Firebase project.

  1. Add an Android app

    In Project settings, scroll to Your apps and click the Android icon.

  2. Enter your package name
    FieldWhat to enter
    Android package nameYour Twinr Android package name, pasted exactly.
    App nicknameOptional. A label used only inside Firebase.
    Debug signing certificate SHA-1Leave empty. Twinr does not require it.

    Click Register app.

    The package name cannot be changed after the app is registered. If you get it wrong, register a second Android app with the correct name — an unused one does no harm.

  3. Download google-services.json

    Click Download google-services.json.

    Firebase then shows SDK installation instructions. Skip them — they are for developers adding Firebase to code by hand. Twinr handles that for you.

  4. Upload it to Twinr

    Open Integrations → Push → Firebase (the page is titled Firebase Notifications) or Integrations → Analytics → Firebase Analytics. Click Upload google-services.json under Config files, then Save as draft.

    The Analytics item in the left menu is App Analytics. It has no upload fields.


3. Create the iOS file

GoogleService-Info.plist connects your iOS app to the same Firebase project.

  1. Add an iOS app

    In Project settings → Your apps, click the iOS+ icon.

  2. Enter your bundle ID
    FieldWhat to enter
    Apple bundle IDYour Twinr iOS bundle ID, pasted exactly.
    App nicknameOptional. A label used only inside Firebase.
    App Store IDLeave empty. It is not needed here.

    Click Register app.

    The bundle ID cannot be changed after the app is registered, exactly as with Android.

  3. Download GoogleService-Info.plist

    Click Download GoogleService-Info.plist.

    Skip the Xcode and SDK steps that follow.

  4. Upload it to Twinr

    Open Integrations → Push → Firebase or Integrations → Analytics → Firebase Analytics. Click Upload GoogleService-Info.plist under Config files, then Save as draft.

Add both platforms, even if you only ship one today. It costs nothing, and it means the other build works the day you decide to release it instead of sending you back here.


4. Create the service account key

The two config files let your app receive notifications. Sending campaigns from Engage needs one more file: a service account key, which authorises Twinr to send on your behalf.

Only required if you run push campaigns from Engage. Push notifications you send yourself from the Firebase console work without it.

  1. Open the Service accounts tab

    In Project settings, select the Service accounts tab.

  2. Generate a private key

    Click Generate new private key, then confirm.

    A .json file downloads immediately.

  3. Store it safely

    This file is a credential, not a config file. Anyone holding it can send notifications to your app's users. Firebase shows it once and cannot show it again — store it somewhere safe, never commit it to a repository, and never put it on a web page.

  4. Upload it to Twinr

    Open Integrations → Push → Firebase, click Upload secret key under Firebase secret key, then Save as draft. This file is only on the Push page, not under Firebase Analytics.

    If Twinr rejects the file, it is not a valid service account key — generate a fresh one rather than reusing google-services.json, which is a different file.


Where the files are used

Frequently asked questions

01Do I need a paid Firebase plan?

No. The free Spark plan covers push notifications and analytics for most apps.

02I already uploaded a file for one feature. Do I upload it again for the other?

No. google-services.json and GoogleService-Info.plist are shared. Upload either one under Push and it shows as uploaded under Firebase Analytics, and the other way round.

03I lost a config file.

Download it again from Project settings → Your apps. Config files are not secrets and can be downloaded as often as you like.

The service account key is different — Firebase cannot show it again. Generate a new one and upload that.

04Can I use a Firebase project I already have?

Yes, provided you add apps matching your Twinr bundle ID and package name. A project created for a website or a different app will not have them.

05I changed my package name or bundle ID in Twinr.

Register a new app in Firebase with the new identifier, download its config file, and upload that. The old file points at the old identifier and stops working.

06Notifications arrive on Android but not iOS.

Check that an iOS app is registered in the same Firebase project and that GoogleService-Info.plist came from it. A .plist from a different project uploads normally and never delivers.