@xmobitea/gn-server
Version:
GearN Server by XmobiTea (Pro)
20 lines (19 loc) • 1.4 kB
TypeScript
export interface OnSendNotificationSuccess {
(message: string): void;
}
export interface OnSendNotificationError {
(error: string): void;
}
export interface IPushNotificationService {
sendNotification(token: string, title: string, body: string, badge?: number, sound?: string, icon?: string, data?: {
[k: string]: any;
}, onSendNotificationSuccess?: OnSendNotificationSuccess, onSendNotificationError?: OnSendNotificationError): Promise<void>;
sendNotificationToMore(tokens: string[], title: string, body: string, badge?: number, sound?: string, icon?: string, data?: {
[k: string]: any;
}, onSendNotificationSuccess?: OnSendNotificationSuccess, onSendNotificationError?: OnSendNotificationError): Promise<string>;
sendNotificationToTopic(topic: string, title: string, body: string, badge?: number, sound?: string, icon?: string, data?: {
[k: string]: any;
}, onSendNotificationSuccess?: OnSendNotificationSuccess, onSendNotificationError?: OnSendNotificationError): Promise<void>;
subscribeToTopic(tokens: string[], topic: string, onSendNotificationSuccess?: OnSendNotificationSuccess, onSendNotificationError?: OnSendNotificationError): Promise<void>;
unsubscribeFromTopic(tokens: string[], topic: string, onSendNotificationSuccess?: OnSendNotificationSuccess, onSendNotificationError?: OnSendNotificationError): Promise<void>;
}