Messaging

Targets

Manage avenues of communication by targeting user's device, email, or phone number in your notifications and messages.

Targets are different ways a user can be reached. For example, a user might have two emails, a phone number as well as a phone and a tablet with your app installed. This means, the user has five different targets that you can deliver messages to.

Topics and targets

A user can have multiple targets, such as emails, phone numbers, and devices with your app installed. These targets can subscribe to a topic, so when messages are published to a topic, all subscribed targets receive the message.

Learn more about topics

Understand how topics work with targets to deliver messages

Types of targets

There are three types of targets you can use to reach your users:

Target TypeDescription
EmailAllows you to send emails to the user's email address.
SMSAllows you to send SMS messages to the user's phone number.
Push notificationAllows you to send push notifications to the user's device.

Add a target

Before you can send messages, make sure you have the appropriate targets added for your user.

Add email target

Verified emails for users that signed up with email password, magic URL, and email OTP login will already have an email target.

Add SMS target

Verified phone numbers for users that signed up with Phone OTP login will already have a phone target.

Add push notification target

Push notifications require configuration on both the Nuvix platform and your client app's code.

  1. In your Firebase console, navigate to Settings > General > Your apps > add an iOS app.
  2. Register and download your GoogleService-Info.plist config file.
  3. Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. The key needs Apple Push Notification Service enabled.
  4. Create a new key, note down the key ID and download your key.
  5. In Firebase console, go to Settings > Cloud Messaging > APNs authentication key > click Upload. Upload your key here.
  6. Add push notification capability to your app by clicking your root-level app in XCode > Signing & Capabilities > + Capabilities > Search for Push Notifications.
  7. If using SwiftUI, disable swizzling by setting FirebaseAppDelegateProxyEnabled to NO in your Info.plist.
Enable Push Notification in XCode

Enable Push Notification in XCode

  1. In your Firebase console, navigate to Settings > General > Your apps > add an Android app.
  2. Register and download your google-services.json config file.
  3. Add google-services.json at the root of your project.
  4. Add Google Services class path to your app-level Gradle dependencies block "com.google.gms:google-services:4.4.0".
  5. Add Google Services plugin to your app-level Gradle in the plugins block as "com.google.gms.google-services".
  6. Add notification handler service to AndroidManifest.xml inside the application tag, alongside other activities. Find an example of this service in the Send push notification journey.
<service android:name="<YOUR_NOTIFICATION_HANDLER_SERVICE>" android:exported="false">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>
  1. Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. The key needs Apple Push Notification Service enabled.
  2. Create a new key, note down the key ID and download your key.
  3. Add push notification capability to your app by clicking your root-level app in XCode > Signing & Capabilities > + Capabilities > Search for Push Notifications.
Enable Push Notification in XCode

Enable Push Notification in XCode

How is this guide?

Last updated on

Targets