Commit 7557b00e authored by Libin Lu's avatar Libin Lu

add createNotificationChannel

parent b884852e
declare module "react-native-fcm" { declare module "react-native-fcm" {
type FCMEventType =
type FCMEventType = "FCMTokenRefreshed" | "FCMNotificationReceived" | 'FCMDirectChannelConnectionChanged'; | "FCMTokenRefreshed"
export module FCMEvent { | "FCMNotificationReceived"
const RefreshToken = "FCMTokenRefreshed"; | "FCMDirectChannelConnectionChanged";
const Notification = "FCMNotificationReceived"; export namespace FCMEvent {
const DirectChannelConnectionChanged: 'FCMDirectChannelConnectionChanged' const RefreshToken = "FCMTokenRefreshed";
} const Notification = "FCMNotificationReceived";
const DirectChannelConnectionChanged: "FCMDirectChannelConnectionChanged";
export module RemoteNotificationResult { }
const NewData = "UIBackgroundFetchResultNewData";
const NoData = "UIBackgroundFetchResultNoData"; export namespace RemoteNotificationResult {
const ResultFailed = "UIBackgroundFetchResultFailed"; const NewData = "UIBackgroundFetchResultNewData";
} const NoData = "UIBackgroundFetchResultNoData";
const ResultFailed = "UIBackgroundFetchResultFailed";
export module WillPresentNotificationResult { }
const All = "UNNotificationPresentationOptionAll";
const None = "UNNotificationPresentationOptionNone"; export namespace WillPresentNotificationResult {
} const All = "UNNotificationPresentationOptionAll";
const None = "UNNotificationPresentationOptionNone";
export module NotificationType { }
const Remote = "remote_notification";
const NotificationResponse = "notification_response"; export namespace NotificationType {
const WillPresent = "will_present_notification"; const Remote = "remote_notification";
const Local = "local_notification"; const NotificationResponse = "notification_response";
} const WillPresent = "will_present_notification";
const Local = "local_notification";
export enum NotificationCategoryOption { }
CustomDismissAction = 'UNNotificationCategoryOptionCustomDismissAction',
AllowInCarPlay = 'UNNotificationCategoryOptionAllowInCarPlay', export enum NotificationCategoryOption {
PreviewsShowTitle = 'UNNotificationCategoryOptionHiddenPreviewsShowTitle', CustomDismissAction = "UNNotificationCategoryOptionCustomDismissAction",
PreviewsShowSubtitle = 'UNNotificationCategoryOptionHiddenPreviewsShowSubtitle', AllowInCarPlay = "UNNotificationCategoryOptionAllowInCarPlay",
None = 'UNNotificationCategoryOptionNone' PreviewsShowTitle = "UNNotificationCategoryOptionHiddenPreviewsShowTitle",
} PreviewsShowSubtitle = "UNNotificationCategoryOptionHiddenPreviewsShowSubtitle",
None = "UNNotificationCategoryOptionNone"
export enum NotificationActionOption { }
AuthenticationRequired = 'UNNotificationActionOptionAuthenticationRequired',
Destructive = 'UNNotificationActionOptionDestructive', export enum NotificationActionOption {
Foreground = 'UNNotificationActionOptionForeground', AuthenticationRequired = "UNNotificationActionOptionAuthenticationRequired",
None = 'UNNotificationActionOptionNone' Destructive = "UNNotificationActionOptionDestructive",
} Foreground = "UNNotificationActionOptionForeground",
None = "UNNotificationActionOptionNone"
export enum NotificationActionType { }
Default = 'UNNotificationActionTypeDefault',
TextInput = 'UNNotificationActionTypeTextInput', export enum NotificationActionType {
} Default = "UNNotificationActionTypeDefault",
TextInput = "UNNotificationActionTypeTextInput"
export interface Notification { }
collapse_key: string;
opened_from_tray: boolean; export interface Notification {
from: string; collapse_key: string;
notification: { opened_from_tray: boolean;
title?: string from: string;
body: string; notification: {
icon: string; title?: string;
}; body: string;
fcm: { icon: string;
action?: string; };
tag?: string; fcm: {
icon?: string; action?: string;
color?: string; tag?: string;
body: string; icon?: string;
title?: string; color?: string;
}; body: string;
local_notification?: boolean; title?: string;
_notificationType: string; };
_actionIdentifier?: string; local_notification?: boolean;
_userText?: string; _notificationType: string;
finish(type?: string): void; _actionIdentifier?: string;
[key: string]: any; _userText?: string;
} finish(type?: string): void;
[key: string]: any;
export interface LocalNotification { }
id?: string;
title?: string; export interface LocalNotification {
body: string; id?: string;
icon?: string; title?: string;
vibrate?: number; body: string;
sound?: string; icon?: string;
big_text?: string; vibrate?: number;
sub_text?: string; sound?: string;
color?: string; big_text?: string;
large_icon?: string; sub_text?: string;
priority?: string; color?: string;
show_in_foreground?: boolean; large_icon?: string;
click_action?: string; priority?: string;
badge?: number; show_in_foreground?: boolean;
number?: number; click_action?: string;
ticker?: string; badge?: number;
auto_cancel?: boolean; number?: number;
group?: string; ticker?: string;
groupSummary?: boolean; auto_cancel?: boolean;
groupAlertBehavior?: string; group?: string;
picture?: string; groupSummary?: boolean;
ongoing?: boolean; groupAlertBehavior?: string;
lights?: boolean; picture?: string;
[key: string]: any; ongoing?: boolean;
} lights?: boolean;
[key: string]: any;
export interface ScheduleLocalNotification extends LocalNotification { }
id: string;
fire_date: number; export interface ScheduleLocalNotification extends LocalNotification {
repeat_interval?: "week" | "day" | "hour" id: string;
} fire_date: number;
repeat_interval?: "week" | "day" | "hour";
export interface Subscription { }
remove(): void;
} export interface Subscription {
remove(): void;
export interface NotificationAction { }
type: NotificationActionType;
id: string; export interface NotificationAction {
title?: string; type: NotificationActionType;
textInputButtonTitle?: string; id: string;
textInputPlaceholder?: string; title?: string;
options: NotificationActionOption | NotificationActionOption[]; textInputButtonTitle?: string;
} textInputPlaceholder?: string;
options: NotificationActionOption | NotificationActionOption[];
export interface NotificationCategory { }
id: string;
actions: NotificationAction[]; export interface NotificationCategory {
intentIdentifiers: string[]; id: string;
hiddenPreviewsBodyPlaceholder?: string; actions: NotificationAction[];
options?: NotificationCategoryOption | NotificationCategoryOption[]; intentIdentifiers: string[];
} hiddenPreviewsBodyPlaceholder?: string;
options?: NotificationCategoryOption | NotificationCategoryOption[];
export class FCM { }
static requestPermissions(): Promise<void>;
static getFCMToken(): Promise<string>; export class FCM {
static on(event: "FCMTokenRefreshed", handler: (token: string) => void): Subscription; static requestPermissions(): Promise<void>;
static on(event: "FCMNotificationReceived", handler: (notification: Notification) => void): Subscription; static getFCMToken(): Promise<string>;
static subscribeToTopic(topic: string): void; static on(
static unsubscribeFromTopic(topic: string): void; event: "FCMTokenRefreshed",
static getInitialNotification(): Promise<Notification>; handler: (token: string) => void
static presentLocalNotification(notification: LocalNotification): void; ): Subscription;
static on(
static scheduleLocalNotification(schedule: ScheduleLocalNotification): void; event: "FCMNotificationReceived",
static getScheduledLocalNotifications(): Promise<LocalNotification>; handler: (notification: Notification) => void
): Subscription;
static removeAllDeliveredNotifications(): void; static subscribeToTopic(topic: string): void;
static removeDeliveredNotification(id: string): void; static unsubscribeFromTopic(topic: string): void;
static getInitialNotification(): Promise<Notification>;
static cancelAllLocalNotifications(): void; static presentLocalNotification(notification: LocalNotification): void;
static cancelLocalNotification(id: string): string;
static scheduleLocalNotification(schedule: ScheduleLocalNotification): void;
static setBadgeNumber(badge: number): void; static getScheduledLocalNotifications(): Promise<LocalNotification>;
static getBadgeNumber(): Promise<number>;
static send(id: string, data: any): void; static removeAllDeliveredNotifications(): void;
static removeDeliveredNotification(id: string): void;
static enableDirectChannel(): void
static isDirectChannelEstablished(): Promise<boolean> static cancelAllLocalNotifications(): void;
static getAPNSToken(): Promise<string> static cancelLocalNotification(id: string): string;
static setNotificationCategories(categories: NotificationCategory[]): void; static setBadgeNumber(badge: number): void;
} static getBadgeNumber(): Promise<number>;
static send(id: string, data: any): void;
export default FCM;
static enableDirectChannel(): void;
static isDirectChannelEstablished(): Promise<boolean>;
static getAPNSToken(): Promise<string>;
static setNotificationCategories(categories: NotificationCategory[]): void;
static createNotificationChannel(config: {
id: string;
name: string;
description?: string;
priority?: string;
});
}
export default FCM;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment