iOS:notification plugin
This commit is contained in:
4
doric-js/index.d.ts
vendored
4
doric-js/index.d.ts
vendored
@@ -797,13 +797,13 @@ declare module 'doric/lib/src/native/notification' {
|
||||
import { BridgeContext } from "doric/lib/src/runtime/global";
|
||||
export function notification(context: BridgeContext): {
|
||||
publish: (args: {
|
||||
biz: string;
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
data?: object | undefined;
|
||||
androidSystem?: boolean | undefined;
|
||||
}) => Promise<any>;
|
||||
subscribe: (args: {
|
||||
biz: string;
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
callback: (data?: any) => void;
|
||||
androidSystem?: boolean | undefined;
|
||||
|
4
doric-js/lib/src/native/notification.d.ts
vendored
4
doric-js/lib/src/native/notification.d.ts
vendored
@@ -1,13 +1,13 @@
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
export declare function notification(context: BridgeContext): {
|
||||
publish: (args: {
|
||||
biz: string;
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
data?: object | undefined;
|
||||
androidSystem?: boolean | undefined;
|
||||
}) => Promise<any>;
|
||||
subscribe: (args: {
|
||||
biz: string;
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
callback: (data?: any) => void;
|
||||
androidSystem?: boolean | undefined;
|
||||
|
@@ -16,13 +16,13 @@
|
||||
import { BridgeContext } from "../runtime/global"
|
||||
export function notification(context: BridgeContext) {
|
||||
return {
|
||||
publish: (args: { biz: string, name: string, data?: object, androidSystem?: boolean }) => {
|
||||
publish: (args: { biz?: string, name: string, data?: object, androidSystem?: boolean }) => {
|
||||
if (args.data !== undefined) {
|
||||
(args as any).data = JSON.stringify(args.data)
|
||||
}
|
||||
return context.notification.publish(args)
|
||||
},
|
||||
subscribe: (args: { biz: string, name: string, callback: (data?: any) => void, androidSystem?: boolean }) => {
|
||||
subscribe: (args: { biz?: string, name: string, callback: (data?: any) => void, androidSystem?: boolean }) => {
|
||||
(args as any).callback = (context as any).function2Id(args.callback)
|
||||
return context.notification.subscribe(args) as Promise<string>
|
||||
},
|
||||
|
Reference in New Issue
Block a user