forked from Kinvey/nativescript-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.d.ts
57 lines (53 loc) · 1.52 KB
/
push.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
declare interface FcmNotificaion {
getBody(): string;
getBodyLocalizationArgs(): string[];
getBodyLocalizationKey(): string;
getClickAction(): string;
getColor(): string;
getIcon(): string;
getSound(): string;
getTag(): string;
getTitle(): string;
getTitleLocalizationArgs(): string[];
getTitleLocalizationKey(): string;
}
declare interface IosInteractiveNotificationAction {
identifier: string;
title: string;
activationMode?: string;
destructive?: boolean;
authenticationRequired?: boolean;
behavior?: string;
}
declare interface IosInteractiveNotificationCategory {
identifier: string;
actionsForDefaultContext: string[];
actionsForMinimalContext: string[];
}
interface PushOptions {
android?: {
senderID: string,
notificationCallbackAndroid?: (jsonDataString: string, notification: FcmNotificaion) => void
};
ios?: {
alert?: boolean,
badge?: boolean,
sound?: boolean,
interactiveSettings: {
actions: IosInteractiveNotificationAction[],
categories: IosInteractiveNotificationCategory[]
},
notificationCallbackIOS?: (message: any) => void
};
notificationCallback?: (message: any) => void;
}
// Push class
export class Push {
private constructor();
static pathname: string;
static isSupported(): boolean;
static onNotification(listener: (notifaction: any) => void);
static onceNotification(listener: (notifaction: any) => void);
static register(options: PushOptions): Promise<string>;
static unregister(options: PushOptions): Promise<null>;
}