Displays an in-app notification.
Use in-app notifications to provide real-time updates and alerts without interrupting the app user's experience. In-app notifications are displayed at the top of the app, and are often used to inform app users of new information.
function showInAppNotification(
body: string,
options: InAppNotificationOptions,
): Promise<InAppNotificationResult>;
Message to be displayed in notification.
In-app notification options.
import { appFramework } from "wix-mobile";
import { openSendWelcomeModal } from "./sendWelcome";
appFramework
.showInAppNotification("@newMember just joined your study group", {
title: "New community member",
avatarImage:
"https://static.wixstatic.com/media/w8ide0_leac4pwk8o11v8725j9ugcbe70x3alc0~mv2.jpg",
})
.then((res) => {
if (res.result === "pressed") {
openSendWelcomeModal();
}
})
.error((error) => {
console.error(error);
});