Identifying Users
By default, the app does not know which user from your website is using a particular device. In the push notification recipient list, devices appear as Unknown User until you tell the app who is logged in.
The firebase_record_user_identity bridge action solves this. Call it after a user logs in on your website, passing any unique identifier for that user. Once recorded, that identity appears in the push notification recipient list — letting you target specific users when sending notifications from the dashboard or via the API.
Sending User Identity
Call this after a successful login on your website:
appilix.postMessage(JSON.stringify({
type: "firebase_record_user_identity",
props: {
user_identity: "user@example.com"
}
}));The user_identity value can be anything that uniquely identifies the user in your system:
- Email address
- User ID
- Username
- Customer ID
When to Call It
Run this code after your website's login process completes — for example, in the success callback of your login form submission, or on the first page load after the user is authenticated.
// Example: run after confirming the user is logged in
if (typeof appilix !== 'undefined') {
appilix.postMessage(JSON.stringify({
type: "firebase_record_user_identity",
props: {
user_identity: currentUser.email
}
}));
}Checking typeof appilix !== 'undefined' ensures this code only runs when inside the app and has no effect in a regular browser.
What Happens After
Once an identity is recorded, that device's entry in the FCM token list is labeled with the identity you provided. You can then:
- Select that user by name in the Send Push Notification page
- Target them using
user_identityin the Push Notification API - Retrieve their token via the FCM Token API
The identity persists until a new identity is recorded for that device (e.g., when a different user logs in on the same device).