Notification
Local / system အသိပေးချက်များကို ပံ့ပိုးပြီး၊ mobile တွင် native channel ကို Importance: Max ဖြင့် ဖန်တီးပေးပါသည်။
- Methods: requestPermission(), sendNotification(title, options)
TSXNotification
1import { Notification, toast } from "@quan-erp/shared-frontend-core";
2
3export async function notifyOrderReady(orderNo: string) {
4 const n = Notification.instance;
5 try {
6 await n.requestPermission();
7 await n.sendNotification(`Order ${orderNo} is ready`, {
8 body: "Tap to open the order",
9 // extra options depend on platform bridge
10 });
11 } catch (e) {
12 toast.error((e as Error).message ?? "Notification failed");
13 }
14}