Landing Pages
Landing Pages are web pages triggered from a notification response that are automatically converted to HTML In-App Automation experiences.
Landing Pages are web pages triggered as an action from a notification response. When a user taps a notification with a landing page action, the landing page is automatically converted to an HTML In-App Automation experience for display.
For general In-App Automation styling options, including HTML customization, see In-App Automation.
Customize Landing Pages
You can customize landing pages by registering a custom action that extends the HTML schedule before display:
Customize landing pages
Airship.actionRegistry.registerEntry(LandingPageAction.DEFAULT_NAMES) {
val action = LandingPageAction { args, schedule ->
val data = schedule.data
val htmlContent = (data as? AutomationSchedule.ScheduleData.InAppMessageData)
?.message?.displayContent as? InAppMessageDisplayContent.HTMLContent
if (data is AutomationSchedule.ScheduleData.InAppMessageData && htmlContent != null) {
// Customize the HTML content
val html = htmlContent.html.copy(forceFullScreenDisplay = true)
val message = data.message.newBuilder()
.setDisplayContent(InAppMessageDisplayContent.HTMLContent(html))
.build()
schedule.newBuilder()
.setData(AutomationSchedule.ScheduleData.InAppMessageData(message))
.build()
} else {
schedule
}
}
ActionRegistry.Entry(action = action)
}Airship.getActionRegistry().registerEntry(LandingPageAction.DEFAULT_NAMES, () -> {
LandingPageAction action = new LandingPageAction(2f, (args, schedule) -> {
AutomationSchedule.ScheduleData data = schedule.getData();
if (data instanceof AutomationSchedule.ScheduleData.InAppMessageData) {
InAppMessage message = ((AutomationSchedule.ScheduleData.InAppMessageData) data).getMessage();
InAppMessageDisplayContent displayContent = message.getDisplayContent();
if (displayContent instanceof InAppMessageDisplayContent.HTMLContent) {
HTML html = ((InAppMessageDisplayContent.HTMLContent) displayContent).getHtml();
// Customize the HTML content
HTML updatedHtml = html.copy(
html.getUrl(),
html.getHeight(),
html.getWidth(),
html.getAspectLock(),
html.getRequiresConnectivity(),
html.getBackgroundColor(),
html.getDismissButtonColor(),
html.getBorderRadius(),
html.getAllowFullscreenDisplay(),
true
);
InAppMessage updatedMessage = message.newBuilder()
.setDisplayContent(new InAppMessageDisplayContent.HTMLContent(updatedHtml))
.build();
return schedule.newBuilder()
.setData(new AutomationSchedule.ScheduleData.InAppMessageData(updatedMessage))
.build();
}
}
return schedule;
});
return new ActionRegistry.Entry(action);
});