ShaunSocial docs ShaunSocial mobile app guide
Version 1.5.6
  • 1.5.6 (this version)

ShaunSocial mobile app guide 1.5.6 / Your app

Push notifications

AdminDeveloper

The ShaunSocial app receives push notifications through Google Firebase, on Android and on iPhones. This page explains how to create the Firebase project, connect your app to it, let Firebase reach iPhones, and give your site the key it sends notifications with. The app needs Firebase even to start, so do this before your first test build.

How push notifications reach the apps#

AdminDeveloper

Last updated: 2026-11-19 · v1.5.6

  1. When the app starts, it connects to your Firebase project and asks the member to allow notifications.
  2. If the member allows them, Firebase gives this phone an address for notifications, and the app sends it to your site once the member is signed in.
  3. When something happens for that member (a message, a comment, a new follower and so on), your site hands the notification to Firebase with your project's key, and Firebase delivers it. For iPhones, Firebase passes it on to Apple's push service, which is why Firebase needs a key from your Apple account.

So three things must belong to the same Firebase project: the app's Firebase files, the Apple key uploaded to Firebase, and the key file on your server. If your website already sends browser notifications through Firebase, use that same project.

StepWho
Create the Firebase projectAdmin
Add the Android and iOS apps and put their files into the appDeveloper
Create the Apple push key and upload it to FirebaseAdmin
Put the service-account key file on the serverAdmin, with the server administrator
Test on real phonesDeveloper

Incoming calls on iPhones (with a calling plugin) are delivered by Apple directly, not through Firebase, and have their own AdminCP settings (see Incoming calls on iPhones).

Read from the code; console steps not run

The app's behaviour on this page was read from the code of the ShaunSocial app 1.5.6. The steps in the Firebase console, on the Apple Developer website and with the command-line tools were not run for this guide, and those tools rename their menus from time to time: look for the same words if a menu is named a little differently.

Create the Firebase project#

Admin

Last updated: 2026-11-19 · v1.5.6

  1. Sign in to the Firebase console with the Google account that should own the project, and click Create a project (or open the project your website's browser notifications already use).
  2. Give it a name, for example your community's name. Google Analytics is optional; the app does not need it.
  3. Add the Developer to the project: Project settings → Users and permissions → Add member, with the role Editor.

Sending push notifications through Firebase is free.

Add the apps and their Firebase files#

Developer

Last updated: 2026-11-19 · v1.5.6

In the source package the app's Firebase files are empty. Until you fill them, the app does not get past its start screen. The simplest way to fill them is the FlutterFire command-line tool, which registers your Android and iOS apps in the Firebase project and writes all the files in one go.

  1. First give the app its own package name and bundle ID (see App name, package name and bundle ID): Firebase registers the apps under these names.
  2. Install the Firebase command-line tool, sign in, and install FlutterFire:
    npm install -g firebase-tools
    firebase login
    dart pub global activate flutterfire_cli
  3. In the shaun_app folder run:
    flutterfire configure
    Choose your Firebase project and the platforms android and ios. When it asks, confirm your package name and bundle ID.

    What you should see: the tool lists the apps it registered and the files it wrote.

FileWhat it is
shaun_app/lib/firebase_options.dartthe settings the app reads when it starts, for both platforms
shaun_app/android/app/google-services.jsonthe Android app's Firebase file
shaun_app/ios/Runner/GoogleService-Info.plistthe iOS app's Firebase file
shaun_app/ios/firebase_app_id_file.jsonthe iOS app's Firebase app ID

You can also add the apps by hand in the Firebase console (Project settings → Your apps → Add app), download the two platform files into the places above, and fill in firebase_options.dart with the values Firebase shows. Run flutterfire configure again whenever you change the package name or bundle ID.

These files are yours

They identify your Firebase project. Do not copy them from another app, and do not share them outside your team.

Let Firebase reach iPhones (the APNs key)#

Admin

Last updated: 2026-11-19 · v1.5.6

Apple delivers every notification to an iPhone itself, through its push service (APNs). Firebase can hand notifications to Apple only with a key from your Apple Developer account.

  1. On the Apple Developer website open Certificates, Identifiers & Profiles → Keys and add a key with Apple Push Notifications service (APNs) ticked.
  2. Download the .p8 file. Apple lets you download it only once: keep it somewhere safe and private. Note the key's Key ID and your Team ID (shown in your membership details).
  3. In the Firebase console open Project settings → Cloud Messaging → Apple app configuration, choose your iOS app, and under APNs Authentication Key click Upload: select the .p8 file and enter the Key ID and Team ID.

One APNs key works for all the apps of your Apple team. The same key can also go into the AdminCP for incoming calls on iPhones (see Incoming calls on iPhones). It is not the In-App Purchase key (see iOS: the In-App Purchase key).

The app project already has the push capability and background notifications switched on; with automatic signing, Xcode enables push for your bundle ID by itself (see Sign the iOS app).

The notification icon on Android#

Developer

Last updated: 2026-11-19 · v1.5.6

Android shows a small icon next to each notification. The app uses notification.png in each mipmap-… folder of shaun_app/android/app/src/main/res/, tinted with launcher_background_color from values/colors.xml. Replace the pictures with your own at the same sizes. Android draws only the shape of this icon, so use a white shape on a transparent background; a full-colour picture shows as a plain square.

Your site's side: the service-account key#

Admin

Last updated: 2026-11-19 · v1.5.6

There is no AdminCP field for app notifications. Your site sends them with the service-account key of your Firebase project, a file that sits on the server:

  1. In the Firebase console open Project settings → Service accounts and click Generate new private key. A file downloads. Keep it private: it lets anyone send notifications in your name.
  2. Give it to your server administrator, who saves it as firebase.json in the site folder. Where exactly, and how, is in the server box of Set up browser notifications in the ShaunSocial guide: browser and app notifications use the same file.

The key must come from the same Firebase project as the app's Firebase files; a key from another project cannot reach your members' phones. The Firebase json and Firebase key pair fields in the AdminCP are for browser notifications on your website only; the app does not need them.

Send a test notification#

AdminDeveloper

Last updated: 2026-11-19 · v1.5.6

  1. Install the app on a real Android phone and a real iPhone (for the iPhone, a TestFlight build or a build run from Xcode). Open it, allow notifications when it asks, and sign in as a member.
  2. Put the app in the background. From the website, signed in as another member, follow the test member or send them a message.

    What you should see: a notification on both phones.

  3. To reach every signed-in app user at once, the Admin can use AdminCP → Mobile Application → Broadcast Message (see Broadcast Message).

When notifications do not arrive#

AdminDeveloper

Last updated: 2026-11-19 · v1.5.6

What you seeLikely cause
The app does not get past its start screenthe Firebase files are still empty or belong to an app with another package name or bundle ID; run flutterfire configure again (see Add the apps and their Firebase files)
Broadcast Message answers "Please config google firebase server key."the firebase.json key file is missing on the server (see Your site's side); without it no app receives notifications
No notifications on any phone, although the key file is therethe key file comes from a different Firebase project than the app's Firebase files
Android phones get notifications, iPhones do notthe APNs key is not uploaded to Firebase, or the Key ID or Team ID is wrong (see Let Firebase reach iPhones)
One member gets nothingthey did not allow notifications; they can switch them on in the phone's settings for your app, then open the app again
The notification icon on Android is a grey or white squarethe notification icon is a full-colour picture (see The notification icon on Android)

Change log#

Last updated: 2026-11-19 · v1.5.6

Date (GMT+7)SectionWhat changed
2026-11-19allFirst version for the ShaunSocial app 1.5.6, written from the 1.5.6 code. The steps in the Firebase console, on the Apple Developer website and with the command-line tools were not run for this guide.
2026-11-19apns-keyLinks updated after the In-app purchases page was split by platform: Android and iOS have their own pages.