Skip to content

Commit efd17bd

Browse files
committed
JPush.sendLocalNotification type definition
1 parent cffba79 commit efd17bd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

index.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ interface JInfoMap {
66
myVersion: string
77
}
88

9+
type ExtraData = {
10+
[key: string]: any
11+
}
12+
13+
interface LocalNotificationOptions {
14+
buildId: 1 | 2 // 设置通知样式,1 为基础样式,2 为自定义样式。自定义样式需要先调用 setStyleCustom 接口设置自定义样式。(Android Only)
15+
id: number // 通知的 id, 可用于取消通知
16+
title: string // 通知标题
17+
content: string // 通知内容
18+
fireTime: number // 通知触发时间的时间戳(毫秒)
19+
extra?: ExtraData // extra 字段
20+
badge?: number // 本地推送触发后应用角标的 badge 值 (iOS Only)
21+
soundName?: string // 指定推送的音频文件 (iOS Only)
22+
subtitle?: string // 子标题 (iOS10+ Only)
23+
}
24+
925
type JSuccessCallback<T = undefined> = (result: T) => void
1026
type JFailCallback = (result: { errorCode: number }) => void
1127
type JResultCallback<T = undefined> = (result: T) => void
@@ -291,7 +307,7 @@ declare class JPush {
291307
* 'subtitle': String // 子标题 (iOS10+ Only)
292308
* }
293309
*/
294-
static sendLocalNotification(notification: Object): void
310+
static sendLocalNotification(notification: LocalNotificationOptions): void
295311

296312
/**
297313
* iOS Only

0 commit comments

Comments
 (0)