forked from NativeScript/push-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinitions.d.ts
More file actions
60 lines (53 loc) · 2.28 KB
/
definitions.d.ts
File metadata and controls
60 lines (53 loc) · 2.28 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
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: string) => void;
}
export declare interface NSError {
code: number;
domain: string;
userInfo: any
}
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;
}
// Common
export declare function register(options: IosRegistrationOptions, successCallback: (token: string) => void, errorCallback: (error: NSError) => void): void;
export declare function register(options: { senderID: string }, successCallback: (fcmRegistrationToken: string) => void, errorCallback: (errorMessage: string) => void): void;
export declare function unregister(successCallback: (successMessage: string) => void): void; // iOS
export declare function unregister(successCallback: (successMessage: string) => void, errorCallback: (errorMessage: string) => void, options: { senderID: string }): void;
export declare function areNotificationsEnabled(callback: (boolean) => void): void;
// Android only
export declare function onMessageReceived(callback: (message: string, stringifiedData: string, fcmNotification: FcmNotificaion) => void): void;
export declare function onTokenRefresh(callback: () => void): void;
// iOS only
export declare function registerUserNotificationSettings(successCallback: () => void, errorCallback: (error: NSError) => void): void;