forked from NativeScript/push-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
60 lines (58 loc) · 2.36 KB
/
Copy pathindex.d.ts
File metadata and controls
60 lines (58 loc) · 2.36 KB
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
58
59
60
// Android only
export 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;
}
export declare function register(options: {
senderID: string;
notificationCallbackAndroid?: (stringifiedData: String, fcmNotification: any) => void;
}, successCallback: (fcmRegistrationToken: string) => void, errorCallback: (errorMessage: string) => void): void;
export declare function unregister(onSuccessCallback: (successMessage: string) => void, onErrorCallback: (errorMessage: string) => void, options: {
senderID: string;
}): void;
export declare function onMessageReceived(onSuccessCallback: (message: string, stringifiedData: string, fcmNotification: FcmNotificaion) => void): void;
export declare function onTokenRefresh(onSuccessCallback: () => void): void;
// iOS only
export declare interface IosInteractiveNotificationAction {
identifier: string;
title: string;
activationMode?: string;
destructive?: boolean;
authenticationRequired?: boolean;
behavior?: string;
}
export declare interface IosInteractiveNotificationCategory {
identifier: string;
actionsForDefaultContext: string[];
actionsForMinimalContext: string[];
}
export declare interface IosRegistrationOptions {
badge: boolean;
sound: boolean;
alert: boolean;
clearBadge: boolean;
interactiveSettings: {
actions: IosInteractiveNotificationAction[];
categories: IosInteractiveNotificationCategory[];
};
notificationCallbackIOS: (message: any) => void;
}
export declare interface NSError {
code: number;
domain: string;
userInfo: any;
}
export declare function register(options: IosRegistrationOptions, successCallback: (token: string) => void, errorCallback: (error: NSError) => void): void;
export declare function registerUserNotificationSettings(success: () => void, error: (error: NSError) => void): void;
export declare function unregister(done: (context: any) => void): void;
// Common
export declare function areNotificationsEnabled(done: (areEnabled: Boolean) => void): void;