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
Types of targets
There are three types of targets you can use to reach your targets.
Target Type | Description |
Allows you to send emails to the user's email. | |
SMS | Allows you to send SMS messages to the user's phone. |
Push notification | Allows 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 Appwrite platform and your client app's code.
In your Firebase console, navigate to Settings > General > Your apps > add an iOS app.
Register and download your google-services.json config file.
Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. The key needs Apple Push Notification Service enabled.
Create a new key, note down the key ID and download your key.
In Firebase console, go to Settings* > Cloud Messaging > APNs authentication key > click Upload. Upload your key here.
Add push notification capability to your app by clicking your root-level app in XCode > Signing & Capabilities > Capabilities > Search for Push Notifications.
If using SwiftUI, disable swizzling by setting FirebaseAppDelegateProxyEnabled to NO in your Info.plist.
In your Firebase console, navigate to Settings > General > Your apps > add an Android app.
Register and download your google-services.json config file.
Add google-services.json at the root of your project.
Add Google Services class path to your app-level Gradle dependencies block "com.google.gms:google-services:4.4.0".
Add Google Services plugin to your app-level Gradle in the plugins block as "com.google.gms.google-services".
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>
Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. The key needs Apple Push Notification Service enabled.
Create a new key, note down the key ID and download your key.
Add push notification capability to your app by clicking your root-level app in XCode > Signing & Capabilities > Capabilities > Search for Push Notifications.