Navigation

Send Mobile Push Notifications

Overview

You can send native push notifications to mobile client applications using the Push Notification Service.

Management Interface

The Push Notifications screen in the Stitch UI lets you write notification drafts, send notifications to users, and define notification rules.

There are four tabs in the Push Notifications screen:

Tab Name Description
Draft

In the Draft tab, you can view a list of the draft messages. For the draft messages, you can:

  • Duplicate draft messages
  • Edit draft messages
  • Delete draft messages
Sent

The Sent tab shows the messages that have already been sent to registered clients. From here, you can view a list of the sent messages. For the sent messages, you can:

  • Resend sent messages.
  • Duplicate sent messages.
Config In the Config tab, you provide the FCM credentials (Sender ID and Legacy API key).
Rules You can optionally specify rules to restrict the types of push notifications that can be sent from your application. See the Push Notification Rules section for details.

Send a Push Notification

You can send new Push Notifications from the Push Notifications page. Click the Send New Notification button to open the Send New Notification dialog. In this dialog, you provide the notification message, label, and the relevant topic audience.

Sending a new Push Notification

Set Up Clients to Receive Push Notifications

The general process of integrating Push Notifications in an Android application is as follows:

  1. Add a dependency for FCM.
  2. Create an FcmServicePushClient.
  3. Use the FcmServicePushClient’s register() method to register the client for push notifications.
  4. Use FirebaseMessaging’s subscribeToTopic() to subscribe to topics.
  5. Create a class that extends the abstract FirebaseMessagingService and implement the onMessageReceived() method. This class handles communication with FCM.
  6. Update AndroidManifest.xml file for your Android project to register your FirebaseMessagingService-derived class and a receiver for your application.

For the latest information on FCM integration with Android clients, see https://firebase.google.com/docs/cloud-messaging/android/client.

To use FCM with Stitch in an iOS app, follow these general steps:

  1. Create a valid Apple Push Notification service (APNs) certificate through the Apple Developer Member center.
  2. Copy the GoogleService-Info.plist file to your XCode project.
  3. Configure FCM and add your iOS app. When you register your app, FCM will return a registration token.

For the latest information and detailed steps on FCM integration with iOS clients, see https://firebase.google.com/docs/cloud-messaging/ios/client.