Skip to main content

Send a push notification

Updated over 2 weeks ago

You will use the Firebase Console to send push notifications.

  1. Open Firebase: Open up the Firebase Console and navigate to the project for your app.

  2. Create notification: Click “Engage” in the sidebar and choose “Messaging”.

    • The first time you do this you will see a “Create your first campaign” button. Click that and choose the “Firebase Notification messages” option.

    • After your first campaign you will see a table of previous notifications. Click “New Campaign” at the top of the table and choose “Notifications”.

  3. Enter notification details: Under “Notification” enter the contents of your notification. If you upload an image, be sure to optimize it as much as possible before hand (shrink it to a reasonable size, compress it, etc.). Images that are too large may not be shown on devices with poor network connections. If you choose not to include an image your app’s icon will be shown instead.

  4. Test notification: You can send yourself a test notification if you'd like.

    1. Open the app on your phone, sign in with an account, and enable “Receive push notifications” under the “Settings” page in the menu.

    2. Open the “Users” table in the admin dashboard, find your account, and click on it.

    3. Click on the token at the top of the “Push notification tokens” card to copy it.

    4. Head back to Firebase and click “Send test message” on your notification.

    5. Paste your token into the field labelled “Add an FCM registration token” and click “Test”.

  5. Choose notification audience: Under “Target” choose “Topic”. Enter one of the supported topics into the “Message topic” box. Do not choose “User segment”, which may result in notifications being sent to users who have opted out of notifications via in-app settings.

  6. Choose notification destination: By default all notifications will link to your app’s home page. You can configure this behavior under “Additional options”. Add a custom data field with a key of “link” and a URL value. To link to a page in your app, use a URL that references that page in your web app. This URL will automatically open in the correct app (native iOS, native Android, or web) depending on where the user receives the notification.

  7. Send: Click “Review” and then “Publish” to send your notification.

Did this answer your question?