Show in app messages in a web or Android app
Fetch messages from the REST API and draw them yourself with platform, version and tier targeting.
Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.
The call
Request the project's messages with your embed key. The answer lists every published message that applies to this caller at this moment.
One GET returns what this caller should see now.
Messages are on the Free plan and on Pro. A Lite board answers with a 403.
A message in the list has an id, a title, a body, a kind and a presentation. It also has an optional action button with a label and a web link, a flag for whether it can be dismissed, and a priority.
The kind is info, warning or critical, and the presentation is banner or alert. Your app maps those to whatever your design system calls a quiet note and a loud one.
The list is ordered by priority, the highest first, and then by the order the messages were written. A page holds up to 100 messages and defaults to 20, which is far more than any app should show at once. Draw the first one or two and ignore the rest until they are dismissed.
const BOARD = 'https://app.votefirst.app/api/v3/projects/your-board';
async function loadMessages(token) {
const headers = { 'X-API-Key': EMBED_KEY };
if (token) headers['X-VF-Token'] = token;
const response = await fetch(BOARD + '/messages?platform=web&app_version=2.4.0', { headers });
const body = await response.json();
return body.data;
}Who gets what
A message can be aimed at iOS, macOS or web, at a range of app versions and at chosen voting tiers. The caller tells the API about itself with two parameters.
The platform, the version and the tier decide.
A message with a window shows only between its start and end times.
Send platform=web, and you get the web messages plus those aimed at everybody. Send no platform, and you get only the messages aimed at everybody. Send app_version, such as 2.4.0, and a message with a version range appears only to a build inside it. Send none, and every message that names a range is left out. A nudge to update therefore reaches old builds and never the new one.
A message aimed at a tier needs a caller whose tier is known, which means a signed in voter with an assignment. An anonymous caller, and a voter with no tier, receive only the untargeted messages. That is the right default for a thank you to paying customers, because nobody who is not one can see it.
On Android
The platform parameter accepts ios, macos and web. An Android app has no value of its own, and sends none.
There is no Android value, so aim at everybody.
That leaves it the messages aimed at all platforms, filtered by version.
Send app_version from the build's version name, and leave platform out. In the dashboard, aim the message at every platform, and give it a version range when it is meant for old builds. A message aimed at the web only will not reach the app, and one aimed at iOS will not either.
That is a limit worth knowing before you plan around it. Targeting by platform works for iOS, macOS and web, and for Android the version range is the one lever you have. Do not send platform=web from an Android app to get at web messages, because they were written for a browser.
Dismissing
To put a message away, post to its dismiss route with the same identity. After that, the list stops returning it to that person.
A dismissal is kept against the person.
A message that is not dismissible answers with a 403, and the button should not be drawn.
The identity is a signed token in the X-VF-Token header, or an anonymous one in X-VF-Anon, which your app mints once and keeps. Without an identity there is nobody to attach the dismissal to, so the call is refused. Show the dismiss button only when the message says it can be dismissed.
Listing messages with an identity also records that the message was delivered, which feeds the received count in the dashboard. A caller with no identity still gets the list, but its dismissals and deliveries are not remembered, so a banner like that would come back on every launch.
async function dismiss(messageId, token) {
await fetch(BOARD + '/messages/' + messageId + '/dismiss', {
method: 'POST',
headers: { 'X-API-Key': EMBED_KEY, 'X-VF-Token': token },
});
}Drawing
A banner sits at the edge of a screen and lets the person carry on. An alert asks for a moment of attention, and a critical one should be rare.
Treat the kind as a hint and the presentation as a request.
Keep titles short, because they are limited to 120 characters and bodies to 600.
Choose the look from your own design system and let the kind pick the color. An info note might use a neutral banner, a warning a yellow one with an optional button, and a critical message a modal that has to be acknowledged. If the message carries an action, draw a button with its label and open its link.
Fetch on launch and again when the app comes back to the front. VoteFirst sends nothing to a closed app, so a message appears only the next time your code asks. The response allows a client to reuse it for a minute, so asking more often than that gains little.
Writing them
A message is a draft until you publish it. It then moves from scheduled to live to ended on its own, according to its start and end times.
Write the message in the dashboard, and publish it.
Editors and owners can write messages, and a viewer cannot.
Set an end time on anything temporary, such as a sync delay, so the notice stops by itself and nobody has to remember to remove it. For each message the dashboard shows how many people received it and how many dismissed it, which tells you whether a notice was noticed.
There is no way to aim a message at one person. The aims are the platform, the version range and the tiers, so write each message for a group and not for an individual.
What the messages API gives an app
One place to say it
Write the note once and every client shows it.
Aim without a release
Target by version and tier without shipping a build.
A note that stays put away
A dismissed message does not come back.
Show your first message in four steps
A web app takes about twenty minutes.
Write and publish a message
Set its kind, presentation and platform in the dashboard.
Fetch the list
Call the messages route with your embed key.
Draw the first message
Map the kind and presentation to your own components.
Add the dismiss call
Post to the dismiss route with the person's identity.
What to know before you build
- There is no push. The app has to be open and asking.
- Android has no platform value, so it sees messages aimed at everybody.
- Messages cannot be aimed at one person.
- Lite does not include messages.
Your in app message questions
Which plans include messages?
The Free plan and Pro. Lite does not, and a Lite board answers the messages call with a 403.
Is there an Android library for messages?
No. The REST API returns messages to any client, and the app draws them.
Which platform value does an Android app send?
None. The values are ios, macos and web, so an Android app omits the parameter and receives messages aimed at everybody.
Why did my message not appear?
Check that it is published, inside its time window, aimed at this platform and version and not already dismissed by this person.
Do anonymous users get messages?
Yes, when the message is not aimed at a tier. A tier message needs a known voter.
Is a message a push notification?
No. It appears when the app asks. Nothing reaches a device where the app is closed.
How long can a message be?
A title of up to 120 characters and a body of up to 600.
Can a message be sent to one person?
No. Messages are aimed by platform, app version and tier.
What does it cost?
Free covers one project and 100 votes. Messages need the Free plan or Pro, which costs $39/mo, and Pro opens with a 14 day trial that asks for no card.
More ways to add a board
More on messages and on the API.
Say it once and reach every client
Write your first message today. Pro opens with a trial of 14 days and takes no card.